Database Worksheet - 3 Query
Database Worksheet - 3 Query
(SENIOR SECONDARY)
CBSE Affiliation Number 1930766
COMPUTER SCIENCE - 083
WORKSHEET
GRADE: 12 TOPIC: DATABASE - 3(QUERY)
1: Study following table ‘Inventory’ and write SQL command to display the name of the costliest car
with fuel type ‘Petrol’. (NCERT Textbook)
CardIDCarNamePrice Model YearmanufactureFueltype Discount
D001 Car1 582613.00 LXI 2017 Pertrol 0.00
D002 Car1 673112.00 VXI 2018 Petrol 6731.00
B001 Car2 567031.00 Sigmal.2 2019 Petrol 6808.00
B002 Car2 647858.00 Deltal.2 2018 Petrol 7774.96
E001 Car3 355205.00 5 STR 2017 CNG 4262.46
STD
E002 Car3 695914.00 CARE 2018 CNG 8350.96
S001 Car4 514000.00 LXI 2017 Petrol 6168.00
S002 Car4 614000.00 VXI 2018 Petrol 7368.00
2: Write SQL command to calculate the average discount and total discount available on Car4.
(Refer table ‘Inventory of 1)[NCERT Textbook]
3: list the total no of cars having no discount. (Refer table ‘Inventory of 1)*NCERT Textbook]
4: Write SQL command to find the highest price for each Car. (Refer table ‘Inventory of 1)
[NCERT Textbook]
5: for the given table ‘Inventory’ in practical 1 arrange and display all records in ascending order of
year of manufacturing.
6: Write the output produced by SQL command “SELECT MONTH(“2002/12/24”);”
10: Consider the table Supplier given below and predict the output for given SQL Command: SELECT
AVG(Status) FROM Supplier;
SID Status
S1 10
S2 30
S3 NULL
S4 40
S5 30
11: Consider the following table ‘Library’ and list all books with their date of purchase (DOP) in
decreasing order.
12: Give the output of SQL Command : (Refer Library table of Practical 11) SELECT
MOD(Qty/Price) FROM Library WHERE Author = ‘Dixit’;
13: Consider ‘Library’ table given in Practical 10 and Count and display all books which Rate is
greater than equal to 200.
14: Predict the output for given SQL Command:
SELECT SUBSTR(1473.8, 3,1)
15: For given table ‘Stock’ Suraj has written following SQL Command to display most expensive
Item Brandwise:
SELECT Iname, Brand, MAX(Rate) FROM Stock;