30040454sql Practical Programsfor Class Xii
30040454sql Practical Programsfor Class Xii
Table: SPORTS
SCode SportsName Number PrizeMoney ScheduleDate
101 Carom Board 2 5000 23-Jan-2012
102 Badminton 2 12000 12-Dec-2011
103 Table Tennis 4 8000 14-Feb-2012
105 Chess 2 9000 01-Jan-2012
108 Lawn Tennis 4 25000 19-Mar-2012
Table: CLUB
CoachID Coach Name Age Sports DateOfApp Pay Sex
1 KUKREJA 35 KARATE 27/03/1996 1000 M
2 RAVINA 34 KARATE 20/01/1998 1200 F
3 KARAN 34 SQUASH 19/02/1998 2000 M
4 TARUN 33 BASKETBALL 01/01/1998 1500 M
5 ZUBIN 36 SWIMMING 12/01/1998 750 M
6 KETAKI 36 SWIMMING 24/02/1998 800 F
7 ANKITA 39 SQUASH 20/02/1998 2200 F
8 ZAREEN 37 KARATE 22/02/1998 1100 F
9 KUSH 41 SWIMMING 13/01/1998 900 M
10 SHAILYA 37 BASKETBALL 19/02/1998 1700 M
i) To show all information about the swimming coaches in the table.
ii) To list names of all coaches with their fate of appointment (DateOfApp) in
descending order.
iii) To display a report, showing Coach Name, Pay,Age and bonus(15% of pay)
for all the coaches.
iv) To insert a new row in the table CLUB with the following data:
11,”PRAKASH”,37,”SQUASH”,{25/02/1998},2500,M
v) SELECT COUNT (DISTINCT SPORTS) FROM CLUB;
3. Write the SQL commands and output of the following:
Table: SENDER
SenderID SenderName SenderAddress SenderCity
ND01 R Jain 2,ABC Appts New Dehi
MU02 H Sinha 12 , Newtown Mumbai
MU15 S Jha 27/A , Park Street Mumbai
MD50 T Prasad 122-K, SDA New Delhi
Table: RECIPIENT
RecID SenderID RecName RecAddress RecCity
KD05 ND01 R Bajpayee 5, Central Avenue Kolkata
ND08 MU02 S Mahajan 116, A Vihar New Delhi
MU19 ND01 H Singh 2A, Andheri East Mumbai
MU32 MU15 P K Swamy B5, CS Terminus Mumbai
ND45 ND50 S Tripathi 13,BID, Mayur Vihar New Delhi
Table: CLIENT
C_ID ClientName City P_ID
01 Cosmetic Shop Delhi FW05
06 Total Health Mumbai BS01
12 Live Life Delhi Sh06
15 Pretty Woman Delhi FW12
16 Dreams Bengluru TP01
Table: CONSIGNOR
CnorID CnorName CnorAddress City
ND01 R Singhal 24, ABC Enclave New Delhi
ND02 Amit Kumar 123, Palm Avenue New Delhi
MU15 R Kohli 5 / A , South Street Mumbai
MU50 S Kaur 27 - K, Westend Mumbai
Table: CONSIGNEE
CneeID CnorID CneeName CneeAddress CneeCity
MU05 ND01 Rahul Kishore 5, Park Avenue Mumbai
ND08 ND02 P Dhingra 16 / J , Moore Enclave New Delhi
KO19 MU15 AP Roy 2A, Central Avenue Kolkata
MU32 ND02 S Mittal P 245, AB Colony Mumbai
ND48 MU50 BP Jain 13, Block DA Vihar New Delhi
Table: STATIONARY
ItemNo Item Scode Qty Rate
1001 Ball Pen 11 20 10
1002 Eraser 11 10 5
1003 Pencil 12 30 2
1004 Notebook 13 25 20
1005 Sharpener 12 15 2
1006 Colors 11 5 15
Table: SUPPLIERS
Scode Sname
11 Rotomac
12 Nataraj
13 Rainbow
i) To display detail of all the items in the table STATIONARY in ascending order
of Qty.
ii) To display ItemNo,Item name of those items from table STATIONARY whose
Rate is more than 15.
iii) To display detail of those items whose Scode is 12 or Qty in Stationary is
more than 10 from the table STATIONARY.
iv) To display minimum Rate of items for each supplier individually as per Scode
from the table STATIONARY:
v) SELECT Rate*Qty FROM STATIONARY WHERE ItemNo = 1001;
Table: STATIONARY
S_ID StationaryName Company Price
DP01 Dot Pen ABC 10
PL02 Pencil XYZ 6
ER05 Eraser XYZ 7
PL01 Pencil CAM 5
GP02 Gel Pen ABC 15
Table: CONSUMER
C_ID ConsumerName Address S_ID
01 Good Learner Delhi PL01
06 Write Well Mumbai GP02
12 Topper Delhi DP01
15 Writer and Draw Delhi PL02
16 Motivation Bengalur PL01
Table: PRODUCT
P_ID ProductName ManufacturerName Price
TP 01 Talcom Powder LAK 40
FW 05 Face Wash ABC 45
BS 01 Bath Soap ABC 55
SH 06 Shampoo XYZ 120
FW 12 Face Wash XYZ 95
Table: CLIENT
C_ID ClientName City P_ID
01 Cosmetic Shop Delhi FW05
06 Total Health Mumbai BS01
12 Live Life Delhi Sh06
15 Pretty Woman Delhi FW12
16 Dreams Bengluru TP01
Table: SPORTS
SCode SportsName Number PrizeMoney ScheduleDate
101 Carom Board 2 5000 23-Jan-2012
102 Badminton 2 12000 12-Dec-2011
103 Table Tennis 4 8000 14-Feb-2012
105 Chess 2 9000 01-Jan-2012
108 Lawn Tennis 4 25000 19-Mar-2012