Sunday 20 November 2011

TCS ILP PAT TEST - DBMS ANSWERS and EXPLANATIONS


These are the answers correct to our perspective .please do confirm it.If you have alternate ideas for any questions please do comment on that you are always welcome .


1.The DBMS acts as an interface between what two components of an
enterprise-class database system?
A.Database application and the database
B.Data and the database
C.The user and the database application
D.Database application and SQL

Ans:  A,i think this question doesnt need any explanation.It is selfexplanatory.

2. SQL stands for ________ .
A.Structured Query Language
B.Sequential Query Language
C.Structured Question Language
D.Sequential Question Language

Ans: obivously it option A.

3. Because it contains a description of its own structure, a database is
considered to be _______ .
A.Described
B.metadata compatible
C.self-describing
D.an application program.

Ans: Again the question is self explanatory ,so answer is C.self describing.

4.You can add a row using SQL in a database with which of the following?
A.ADD
B.CREATE
C.INSERT
D.MAKE

Explanation: 

The INSERT INTO statement is used to insert a new row in a table.
syntax:
INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...)

Ans: C

5.The wildcard in a SELECT statement is which of the following?
A.%
B.&
C.∗
D.#

Explanation:
SQL wildcards can substitute for one or more characters when searching for data in a database.

SQL wildcards must be used with the SQL LIKE operator.

we have the following "Persons" table:

P_Id         LastName              FirstName               Address City
1                             Hansen Ola          Timoteivn 10                 Sandnes
2                             Svendson Tove  Borgvn 23                     Sandnes
3                             Pettersen Kari        Storgt 20                       Stavanger

Using the % Wildcard

Now we want to select the persons living in a city that starts with "sa" from the "Persons" table.

We use the following SELECT statement:

SELECT * FROM Persons
WHERE City LIKE 'sa%'
The result-set will look like this:

P_Id LastName                  FirstName                      Address City
1 Hansen Ola                     Timoteivn 10                       Sandnes
2 Svendson Tove Borgvn 23                        Sandnes

courtesy : www.w3schools.com

Ans: A.%

6.The command to eliminate a row from a table is:
A.REMOVE FROM CUSTOMER
B.DROP FROM CUSTOMER
C.DELETE FROM CUSTOMER
D.UPDATE FROM CUSTOMER

Exp:
The DELETE statement is used to delete rows in a table.

SQL DELETE Syntax

DELETE FROM table_name
WHERE some_column=some_value

Ans:- C,where the CUSTOMER is the table name.


7. The SQL WHERE clause:
A.limits the column data that are returned.
B.limits the row data are returned.
C.Both A and B are correct.
D.Neither A nor B are correct.

Exp:
The WHERE clause is optional.The WHERE clause filters rows from the FROM clause tables. Omitting the WHERE clause specifies that all rows are used.

Ans: B

8. Which of the following is the original purpose of SQL?
A.To specify the syntax and semantics of SQL data definition language
B.To specify the syntax and semantics of SQL manipulation language
C.To define the data structures
D.All of the above.

Ans.D

9. The wildcard in a WHERE clause is useful when?
A.An exact match is necessary in a SELECT statement.
B.An exact match is not possible in a SELECT statement.
C.An exact match is necessary in a CREATE statement.
D.An exact match is not possible in a CREATE statement.

Exp:the explanation given in the 5 question can explain this question also.

Ans: B


10. A view is which of the following?
A.A virtual table that can be accessed via SQL commands
B.A virtual table that cannot be accessed via SQL commands
C.A base table that can be accessed via SQL commands
D.A base table that cannot be accessed via SQL commands


Explanation:
In SQL, a view is a virtual table based on the result-set of an SQL statement.A view contains rows and columns, just like a real table. The fields in a view are fields from one or more real tables in the database.


Ans: A

11.The command to eliminate a table from a database is:
A.
REMOVE TABLE
CUSTOMER;
B.
DROP TABLE CUSTOMER;
C.
DELETE TABLE CUSTOMER;
D.
UPDATE TABLE
CUSTOMER;

Exp:
The DROP TABLE statement is used to delete a table.
syntex:
DROP TABLE table_name

Ans: B.where CUSTOMER  is the table name.

12. ON UPDATE CASCADE ensures which of the following?
A.
Normalization
B.
Data Integrity
C.
 Materialized Views
D.
All of the above.

Ans:B.Data Integrity

13. SQL data definition commands make up a(n) ________ .

A.DDL
B.DML
C.HTML 
D.XML

Exp: sql data definition commands make up a data definition language DDL
Ans:A


14. The SQL keyword(s) ________ is used with wildcards.
A.LIKE only
B.IN only
C.NOT IN only
D.IN and NOT IN

Exp:
SQL wildcards can substitute for one or more characters when searching for data in a database.
SQL wildcards must be used with the SQL LIKE operator.Example of 5 th question can be used to understand

Ans:A

15. Which of the following is the correct order of keywords for SQL SELECT
statements?
A.SELECT, FROM, WHERE
B.FROM, WHERE, SELECT
C. WHERE, FROM,SELECT
D.SELECT,WHERE,FROM

Exp:
Example statement :SELECT * FROM Persons
WHERE City LIKE 'sa%'

Ans:A

16. A subquery in an SQL SELECT statement is enclosed in:

A.braces — {...}.
B.CAPITAL LETTERS.
C.parenthesis — (...)
D.brackets — [...].

Ans:C parenthesis

17. The result of a SQL SELECT statement is a(n) ________ .

A.report
B.form
C.file
D.table

Ans: D.table

18. Which one is not the command of DDL?
A. create
B. alter
C. delete
D. drop

Ans: C




No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...