You are on page 1of 2

RSK INTERNATIONAL SCHOOL (CBSE)

(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”);”

7: Write the output produced by SQL command “SELECT ROUND(618.4391,-2);”

8: Display output of SQL Command “SELECT SUBSTR(“techtipnow computers”, 12);”

9: Write output of SQL Command “SELECT MONTHNAME(curdate());”

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.

No Title Author Type DOP Qty price


1 Data Structure Dixit DS 12/10/2003 4 300
2 Computer Studies French FND 11/11/2003 2 75
3 Advanced Pascal Shildt PROG 01/12/2003 4 350
4 Dbase Dummies Palmer DBMS 23/12/2003 5 130
5 Mastering C++ Dixit PROG 08/01/2004 3 295
6 Guide Network Freed NET 10/02/2004 3 200
7 Mastering Foxpro Seigal DBMS 17/02/2004 2 135
8 DOS Guide Norton OS 11/03/2004 3 175
9 Basic for beginner Morton PROG 21/04/2004 3 40
10 Mastering C Programs Dixit PROG 06/05/2004 1 195

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;

But he is getting desired output. help him to write correct command.

Icod Iname Brand Qty Rate


e
101 Soap Lux 100 34
102 Salt Patanjali 110 20
103 Sugar Annapurna 200 56
104 Coffe Nestle 60 140
105 Maggi Nestle 90 83
106 Cake Britannia 40 10
107 Biscuit Britannia 130 5
108 Musturd Patanjali 75 180
Oil
109 Jam Kissan 20 54
110 Tea Brook 30 160
Bond

You might also like