Tuesday, October 20, 2015

SQL SAMPLE QUESTIONS


questionStatement
answerA
answerB
answerC
answerD
answerE
Which of the following can be a valid column name?
AccountType_#12
#Serial Number
2_Address
Column
All of the above
Which of the following commands will not write to the rollback segment after deleting all the data from a table?
DROP
DELETE
CASCADE
TRUNCATE

Which of the following SQL functions can operate on any datatype?
MIN
FLOOR
LPAD
TO_CHAR
LOWER
What is the minimum number of joins required after WHERE clause for avoiding a cartesian product of 5 tables?
6
5
3
4

Which of the following queries output names of all the employees from a table "Employees", whose "Job Type" includes either of the substrings "MG" or "DG"?
SELECT Emp_name FROM Employees WHERE JobType='%MG%' or JobType='%DG%'
SELECT Emp_name FROM Employees WHERE JobType Like '%MG%' or JobType Like '%DG%'
SELECT Emp_name FROM Employees WHERE JobType= ='%MG%' or JobType= ='%DG%'
SELECT Emp_name FROM Employees WHERE JobType Like   '%MG%' or   '%DG%'

The table "Sales" is used to maintain the records by the sales department of a company. The column "OrderNo" is the primary key of the table. Which of the following SQL statements will have the index on "OrderNo" ignored?
Select OrderNo, Product Name from Sales where OrderNo = '1024'
Select * from Sales where OrderNo = '1024'
Select * from Sales where nvl(OrderNo, '00000') = '1024'
Select 1 from Sales where OrderNo = '1024'

On the issue of following command, what task could Ed perform on the student table?   GRANT update   ON student   To ed   WITH GRANT OPTION;
View data.
Delete data.
Modify constraints.
Give update access to other users.
None of the above.
Which of the following statements is correct?
Foreign key cannot be defined on a combination of columns.
The foreign key and referenced key can exist in the same table.
Referential integrity is defined in the child table.
None of the above.

Which of the following options is not a valid set operator in SQL?
UNION
UNION ALL
INTERSECT
MINUS
All of the above are valid
A query within a query where the inner query is evaluated for each row in the outer query is called:
Join
View
Correlated subquery
None of the above

No comments:

Post a Comment