Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
266 views

SQL Sample Questions

The document contains questions and multiple choice answers about SQL concepts. The questions cover valid column names, commands that don't write to the rollback segment after deleting table data, SQL functions that can operate on any data type, the minimum number of joins needed to avoid a cartesian product, queries that output employee names matching job type substrings, which SQL statements will ignore an index on a primary key column, the task a user can perform after being granted an update privilege, statements about foreign keys and referential integrity, valid SQL set operators, and the term for a query within a query where the inner query is evaluated for each outer query row.

Uploaded by

vaishali0000
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
266 views

SQL Sample Questions

The document contains questions and multiple choice answers about SQL concepts. The questions cover valid column names, commands that don't write to the rollback segment after deleting table data, SQL functions that can operate on any data type, the minimum number of joins needed to avoid a cartesian product, queries that output employee names matching job type substrings, which SQL statements will ignore an index on a primary key column, the task a user can perform after being granted an update privilege, statements about foreign keys and referential integrity, valid SQL set operators, and the term for a query within a query where the inner query is evaluated for each outer query row.

Uploaded by

vaishali0000
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

questionStatement answerA answerB answerC answerD

answer
E
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

You might also like