Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

IE 323

COMPUTER APPLICATION II [IE 323]


SAMPE MAJOR 1 Exam FOR SPRING 2021
MAX. TIME : 90 Min MAX. MARKS: 20
Name :_____________________________

Computer No :_____________________________
Attempt all the questions.
Please Run the SQL file provided “FE.SQL”. It will create all the tables and insert all the data.
1) Create the following GYM information system.
a) Member323
MNO, MNAME, DOB, M_HEAD_NO, Gender , EARNED_POINTS
b) COACH323
CNO, CNAME, CTYPE, PRICE_PER_HOUR, C_HEAD_NO
c) Booking323
MNO, CNO, RESERVE_DATE, RESERVE_ TIME , NO_OF_HOURS
d) MLEVEL323
MSTATUS , LPOINT , HOINT

Tables Data
MEMBER323
MN
O MNAME DOB M_HEAD_NO GENDER EARNED_POINTS
101 FAISAL 12-Jun-91 103 MALE 900
102 IRUM 9-Jan-84 103 FEMALE 1800
103 MALBARI 18-Feb-85   MALE 2700
104 BELADI 21-Mar-80 103 MALE 1400

COACH323

CNO CNAME CTYPE PRICE_PER_HOUR C_HEAD_NO

10001 AMMAR SWIMMING 150 10002

10002 HISHAMM BOXING 250  

10003 REHAN BOXING 200 10002

10004 ATEF YOUGA 120 10002

BOOKING323
MN
O CNO RESERVE_DATE RESERVE_TIME NO_OF_HOURS

102 10001 17-Mar-19 13 2

102 10004 22-May-18 14.3 3

101 10001 28-May-18 9.3 4

103 10003 23-May-18 16 6

102 10002 29-May-18 13.3 7

Page | 1 of 5
IE 323

MLEVEL323
LPOIN
MSTATUS T HPOINT

YELLOW 0 999

SILVER 1000 1999

GOLD 2000 2999

1. Display the following columns:


MNAME, MEMBER MSTATUS , CNAME , COACH_HEAD_NAME , MEMBER_HEAD_NAME ,
MEMBER_HEAD_MSTATUS, TOTAL_AMOUNT(NO_OF_HOURS * PRICE_PER_HOUR). Display
even those COACHS which don’t have Head (5 MARKS)
COACH_HEAD_NA TOTAL_AMOUN
MNAME MSTATUS CNAME M MEMBER_HEAD_NAME MEMBER_HEAD_STATUS T
IRUM SILVER AMMAR HISHAMM MALBARI GOLD 300
IRUM SILVER ATEF HISHAMM MALBARI GOLD 360
FAISAL YELLOW AMMAR HISHAMM MALBARI GOLD 600
HISHAM
IRUM SILVER M   MALBARI GOLD 1750

Page | 2 of 5
IE 323

2) Display the coach with HIGHEST total payment (Total payment is calculated based on
NO_OF_HOUR and PRICE_PER_HOUR). (2.5 marks)
CNAME HIGHEST_TOTAL_COACH_PAYMENT
HISHAMM 1750

3) Display all the Members who were born on the same day of the week as his MEMBER HEAD was
born and display their AGE in years using graphic representation every 5 years represent one ‘#’
(round the age). (3 MARKS)
MNAM
E M_AGE_IN_YEAR M_HEAD_NAM HEAD_AGE_IN_YEAR
IRUM ####### MALBARI #######

Page | 3 of 5
IE 323

4) Increase the price_per_hour for each coach as PER TOTAL AMOUNT . If total amount is between 0
to 899 increase 30% and if between 900 and 1799, then increase 50% rest all increase 60%. (3 marks)
TOTAL_AMOUNT_FOR_EACH_CO PRICE_PER_HOU NEW_PRICE_PER_HO
CNAME AH R UR
REHAN 1200 200 300
ATEF 360 120 156
HISHAM
M 1750 250 375
AMMAR 900 150 225

5. Find the SECOND occurrence of letter ‘M’ in CNAME , and change second M to W.
Display only those persons who have two MM’s in their names. (4 MARKS)

CNAME NEW_CNAME
AMMAR AMWAR
HISHAM
M HISHAMW

Page | 4 of 5
IE 323

6. Display the MSTATUS with the highest members. (2.5 Mark )

Page | 5 of 5
IE 323

**** Best of Luck ****

Page | 6 of 5

You might also like