1. What is a subquery?
a) A subquery is a select-from-where expression that is nested within another query
b) A subquery is any query that is nested within another query
c) A subquery is a relation that is externally specified which can be used to handle data in queries
d) A subquery is a condition that excludes all the invalid tuples from the database
2. If a set is a collection of values given by the select clause, The ______ connective tests for set membership
3. State true or false : Nested Subqueries cannot be used for comparing two different sets
4. What is the result of the following query?
SELECT studname FROM college WHERE marks > SOME (SELECT marks FROM student WHERE SECTION = 'c');
a) The query gives all the studnames for which marks are greater than all the students in section c
b) The query gives all the studnames for which the marks are greater than at least on student in section c
c) The query gives all the studnames for which the marks are less than all the students in section c
d) The query is syntactically incorrect
5. The ________ comparison checker is used to check “each and every” condition
6. The ______ construct returns true if a given tuple is present in the subquery.
a) not exists
c) not present
7. What is a correlated sub-query?
a) An independent query that uses the correlation name of another independent query.
b) A sub-query that uses the correlation name of an outer query
c) A sub-query that substitutes the names of the outer query
d) A sub-query that does not depend on its outer query’s correlation names
8. The _________ construct returns true if the argument in the sub-query is void of duplicates
a) not null
b) not unique
9. State true or false: We can use Subqueries inside the from clause
10. Choose the correct option regarding the following query
WITH max_marks (VALUE) AS (SELECT MAX(marks) FROM student) SELECT studentID FROM student,max_marks WHERE student.marks = max_marks.value;
a) The query is syntactically wrong
b) The query gives the studentID of the student with the maximum marks
c) The query gives the maximum marks amongst all the students
d) The query gives all the studentID values except the student with the maximum marks
11. SQL subqueries that can occur wherever a value is permitted provided the subquery gives only one tuple with a single attribute are called _________
a) Exact Subqueries
b) Vector Subqueries
c) Positive Subqueries
d) Scalar Subqueries