A School in Delhi uses database management system to store student details. The school maintains a database 'school_record' under which there are two tables.
Student Table : Maintains general details about every student enrolled in school.
StuLibrary Table : To store details of issued books. BookID is the unique identification number issued to each book. Minimum issue duration of a book is one Day.
Student |
Field |
Type |
StuID |
numeric |
StuName |
Varchar[20] |
StuAddress |
Varchar[50] |
StuFatherName |
Varchar[20] |
StuContact |
numeric |
StuAadhar |
numeric |
StuClass |
Varchar[5] |
StuSection |
Varchar[1] |
StuLibary |
Field |
Type |
BookID |
numeric |
StuID |
numeric |
Issued_date |
Date |
Return_date |
Date |
i. Identify the SQL Query which displays the data of StuLibrary table in ascending order of StudentID.
(i) Select * from StuLibrary Order By BookID
(ii) Select * from StuLibrary Order By StuID \
(iii) Select * from StuLibrary Order By StuID ASC
(iv) Select * from StuLibrary Order By StuID DESC
Choose the correct option:
a. Both Query i) and iv) will display the desired data.
b. Both Query i) and ii) will display the desired data.
c. Both Query iii) and iv) will display the desired data.
d. Both Query ii) and iii) will display the desired data.
ii. The Primary Key for StuLibrary Table is/are …….
a. BookID
b. BookID,StuID
c. BookID,Issued_date
d. Issued_date
iii. Which of the following SQL Query will fetch ID of those issued books which have not been returned?
a. SELECT BookID from StuLibrary where BookID is NULL;
b. SELECT BookID from StuLibrary where StuID is NULL;
c. SELECT BookID from StuLibrary where Issued_date is NULL;
d. SELECT BookID from StuLibrary where Return_date is NULL;
iv. The Alternate Key for Student Table will be ……….
a. StuName
b. StuContact
c. StuAadhar
d. StuClass
v. Which of the following SQL Query will display dates on which number ofissued books is greater than 5?
a. SELECT Issued_date from StuLibrary GROUP BY Issued_datewhere COUNT(*)>5;
b. SELECT Issued_date from StuLibrary GROUP BY Return_datehaving count(*)>5
c. SELECT Issued_date from StuLibrary GROUP BY Issued_datehaving count(*)>5
d. SELECT Issued_date from StuLibrary GROUP BY Return_datewhere COUNT(*)>5