0% found this document useful (0 votes)
284 views2 pages

MySQL Assignment Question

The document contains three tables (ACTIVITY, COACH, GAMES) with questions about writing SQL queries to retrieve, insert, and delete data from the tables. The questions include displaying data ordered by different columns, calculating sums, and adding/deleting rows.

Uploaded by

William Kuga
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
284 views2 pages

MySQL Assignment Question

The document contains three tables (ACTIVITY, COACH, GAMES) with questions about writing SQL queries to retrieve, insert, and delete data from the tables. The questions include displaying data ordered by different columns, calculating sums, and adding/deleting rows.

Uploaded by

William Kuga
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 2

MySql Assignment Questions

1. Q1. Consider the following tables ACTIVITY and COACH. Write SQL commands for
the following statements.
Table: ACTIVITY
Acode ActivityName Stadium ParticipantsNum PrizeMoney ScheduleDate
1001 Relay 100 X 4 Star Annex 16 10000 23-Jan-04
1002 High Jump Star Annex 10 12000 12-Dec-03
1003 Shot Put Super 12 8000 14-Feb-04
Power
1005 Long Jump Star Annex 12 9000 01-Jan-04
1008 Discuss Throw Super 10 15000 19-Mar-04
Power

Table: COACH
PCODE NAME ACODE
1 Ahmed Hussain 1001
2 Ravinder 1008
3 Janila 1001
4 Naaz 1003

(i) To display the names of all activities with their Acode in descending
order.
(ii) To display sum of prizemoney for the activities played in each of the
stadium separately.
(iii) To display the coach’s names and acodes in ascending order of Acode
from the table COACH.
(iv) To display the content of all activities for which ScheduleDate is earlier
than 01-01-2004 in ascending order of ParticipentsNum.
(v) Insert a row in table coach (5,’Shyam’,1003)

2. Consider the following table GAMES. Write SQL commands for the following
statements
Table: GAMES
GCODE GAMENAME TYPE NUMBER PRIZEMONEY SCHEDULEDATE
101 CAROM INDOOR 2 5000 23-Jan-2004
BOARD
102 BADMINTON OUTDOOR 2 12000 12-Dec-2003
103 TABLE TENNIS INDOOR 4 8000 14-Feb-2004
105 CHESS INDOOR 2 9000 01-Jan-2004
108 LAWN TENNIS OUTDOOR 4 25000 19-Mar-2004

(i) To display the name of all GAMES with their GCodes


(ii) To display details of those games which are having PrizeMoney more
than 7000.
(iii) To display the content of the GAMES table in ascending order of
scheduleDate.
(iv) To display sum of PrizeMoney for each type of GAMES.
(v) Insert a row in table (109,’Cricket’,’INDOOR’,5,10000,11-Mar-2005

3. Consider the following table WORKER. Write SQL commands for the following
statements:
Table: WORKER
ECODE NAME DESIG PLEVEL DOJ DOB
11 Radhe shyam Supervisor P001 13-Sep-2004 23-Aug-1981
12 Chander Nath Operator P003 22-Feb-2010 12-Jul-1987
13 Fizza Operator P003 14-Jun-2009 14-Oct-1983
15 Ameen Ahmed Mechanic P002 21-Aug-2006 13-Mar-1984
18 Sanya Clerk P002 19-Dec-2005 09-Jun-1983

(i) To display the details of all workers in descending order of DOB.


(ii) To display NAME and DESIG of those WORKERS, whose PLEVEL is either
P001 or P002.
(iii) To display the content of all the WORKERS table, whose DOB is in
between ’19-JAN-1984’ and ’18-JAN-1987’
(iv) TO ADD A NEW ROW WITH THE FOLLOWING:
19,’Daya Kishore’,’Operator’,’P003’,’19-Jun-2008’,’11-Jul-1984’
(v) Delete from workers where ecode=18

You might also like