MCQs:
1)
2)
3)
4)
5)
6)
7) The purpose of the GROUP BY clause in a SQL is to:
(A) Filter rows based on a condition.
(B) Combine rows with identical values into summary rows.
(C) Sort the result set.
(D) Specify which columns to display.
8) Identify the SQL command used to delete a relation (table) from a
relationaldatabase.
(A) DROP TABLE (B) REMOVE TABLE (C)DELETE TABLE
(D) ERASE TABLE
9) State whether the following statement is True or False:
In SQL, the HAVINGclause is used to apply filter on groups formed by the
GROUPBYclause.
10) (A)Both Assertion (A) and Reason (R) are true, and Reason (R) is
thecorrect
explanation of Assertion (A)
(B)Both Assertion (A) and Reason (R) are true, but Reason (R) is
not thecorrect
explanation of Assertion (A)
(C)Assertion (A) is True, but Reason (R) is False Assertion (A) is
False, but Reason (R) is True
Assertion (A): In SQL, INSERT INTOis a Data Definition Language
(DDL)Command.
Reason (R): DDL commands are used to create, modify, or remove
databasestructures, such as tables.
SECTION B
11)Consider the string: "Kendriya Vidyalaya Sangathan". Write suitable SQL queries for the
following:
(i)To extract and display "Vidyalaya" from the string.
(ii)Display the position of the first occurrence of "Vidya" in the given string
12) Define the term Primary Key in a database. Explain how it is different from a UNIQUE
Key.
13) Consider the table 'Teacher' given below.
Teacherl Departmen Period
d t s
T101 Science 32
T102 Null 30
T103 Mathemati 34
cs
What will be the output of the following queries on the basis of the above
table :
(i) Select count(Department) from Teacher;
(ii) Select count(*) from Teacher
Consider the string: "SQL Query Language". Write suitable SQL queries for
the following:
I. To extract and display "Query" from the string.
II. Display the position of the first occurrence of "Query" in the given string.
14)
SECTION C:
1)
2)
3)
4)
5)
6(
7(
8)
9)
10)