XII IP Practical Lab Activity 5

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Lab Activity 5

Practical 1: Consider the following table ‘Cloth’ and display name of cloth in capital letters purchased in year 2020.
CCode CName Size Colour Price DOP

C001 Jeans L Blue 1230.67 11/12/20

C002 Jeans XL Blue 1340.89 14/12/20

C003 Shirt XL Red 870.50 24/11/20

C004 Trouser L Khaki 990.99 02/01/21

C005 T-Shirt XL White 552.45 08/01/21

Practical 2: for given table ‘Cloth’ of Practical 1, write SQL command to display number of cloths purchased each
year.

Practical 3: Write the output of the following SQL command:


SELECT ROUND(288.795,-2);

Practical 4: For table ‘Salesman’ with fieldnames sid, sname, zone, amount, Write SQL command to display all
salesman name in descending order.
practical 5: Consider table ‘Items’ and write SQL query to display average qty available for each Brand where
average qty is/are more than 50.
Icode Iname Brand Qty Rate

101 Soap Lux 100 34

102 Salt Patanjali 110 20

103 Sugar Patanjali 200 56

104 Coffe Nestle 60 140

105 Maggi Nestle 90 83

106 Cake Britannia 20 10

107 Biscuit Britannia 130 5

108 Musturd Oil Patanjali 75 180

109 Jam Kissan 20 54

110 Tea Brook Bond 30 160

Practical 6: for given table ‘Items’ of Practical 5, Display minimum rate of item of ‘Patanjali’.

Practical 7: Write SQL command to display name of weekday of your date of birth.

Practical 8: Write SQL command to count number of characters in your school name.
Practical 9: Display the output of following SQL command:
SELECT RIGHT(SUBSTR(‘GATEWAY OF INDIA’,-8,5),2);

Practical 10: Write SQL command to calculate cube of 8.

Practical 11: Write the output of SQL command:


SELECT LENGTH(TRIM(“###Zydus computers## “)); (# refers to blank space)

Practical 12: for the given table ‘Hospital’ write SQL command to display name all patient admitted in month of
May.
PID PNAME GENDER ADMITDATE DEPT FEES

AP/PT/001 Rahil Khan M 21/04/2019 ENT 250

AP/PT/002 Jitendal Pal M 12/05/2019 Cardio 400

AP/PT/003 Suman Lakra F 19/05/2019 Cardio 400

AP/PT/004 Chandumal Jain M 24/06/2019 Neuro 600

Practical 13: For given table ‘Hospital’ in Practical 10, List and count total Male/Female patient.

Practical 14: For given string “tZydus computer education”, Write SQL command to display the position of
“education”.

Practical 15: For given table ‘Order’ display those customer nos that have more than 2 orders.
Ono Cno Ino Qty Total

1 1 1 10 100

2 2 1 10 100

3 3 2 5 60

4 4 3 10 200

5 1 2 10 120

6 5 1 10 100

7 4 3 5 100

You might also like