0% found this document useful (0 votes)
69 views3 pages

XII IP Practical 2023 Lab Activity 4

This document outlines 15 lab activities and practical exercises involving SQL commands and queries on sample tables. The practicals involve writing SQL commands to display specific data from tables based on conditions, perform calculations on data, order and group results, and predict output.

Uploaded by

Ria Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views3 pages

XII IP Practical 2023 Lab Activity 4

This document outlines 15 lab activities and practical exercises involving SQL commands and queries on sample tables. The practicals involve writing SQL commands to display specific data from tables based on conditions, perform calculations on data, order and group results, and predict output.

Uploaded by

Ria Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Lab Activity 4

Practical 1: Study following table ‘Inventory’ and write SQL command to display the name of the costliest
car with fuel type ‘Petrol’. (NCERT Textbook)
CardID CarName Price Model Yearmanufacture Fueltype 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 STD 2017 CNG 4262.46

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

Practical 2: Write SQL command to calculate the average discount and total discount available on Car4.
(Refer table ‘Inventory of Practical 1)[NCERT Textbook]

Practical 3: list the total no of cars having no discount. (Refer table ‘Inventory of Practical 1)*NCERT
Textbook]

Practical 4: Write SQL command to find the highest price for each Car. (Refer table ‘Inventory of Practical
1)[NCERT Textbook]

Practical 5: for the given table ‘Inventory’ in practical 1 arrange and display all records in ascending order
of year of manufacturing.

Practical 6: Write the output produced by SQL command “SELECT MONTH(“2002/12/24”);”


Practical 7: Write the output produced by SQL command “SELECT ROUND(618.4391,-2);”
Practical 8: Display output of SQL Command “SELECT SUBSTR(“Zydus School computers”,
12);”

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


Practical 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
Practical 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

Practical 12: Give the output of SQL Command : (Refer Library table of Practical 11) SELECT
MOD(Qty/Price) FROM Library WHERE Author = ‘Dixit’;

Practical 13: Consider ‘Library’ table given in Practical 10 and Count and display all books which Rate is
greater than equal to 200.

Practical 14: Predict the output for given SQL Command:


SELECT SUBSTR(1473.8, 3,1)

Practical 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.


Icode Iname Brand Qty Rate

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 Oil Patanjali 75 180

109 Jam Kissan 20 54

110 Tea Brook Bond 30 160

You might also like