0% found this document useful (0 votes)
8 views9 pages

CS Final Project 2

Uploaded by

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

CS Final Project 2

Uploaded by

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

Q1 :- Write the SQL Commands For The Following On The Basis Of Given

Ta b l e S TUDENT :

Student Name Class Game Grade1 SUPW Grade2


NO.
10 Sameer 7 Cricket B Photography A
11 Sujit 8 Tennis A Gardening C
12 Kamal 7 Swimming B Photography B
13 Veena 7 Tennis C Cooking A
14 Archana 9 Basket Ball A Literature A
15 Arpit 10 Cricket A Gardening C
1. Display The Name Of Students Who Are Getting a Grade ‘C” In either
GAME OR SUPW.
2. Display The Different Games Offered In the School.
3. Display The SUPW Taken By The Students, Whose Name Start With ‘A’
. OUTPUT:-

Page 1 of 9
Q2:- Write the SQL Commands For The Following On The Basis Of Given
Table SPORTS :

Student Name Class Game Grade1 Game2 Grade2


NO.
10 Sameer 7 Cricket B Photography A
11 Sujit 8 Tennis A Gardening C
12 Kamal 7 Swimming B Photography B
13 Veena 7 Tennis C Cooking A
14 Archana 9 Basket Ball A Literature A
15 Arpit 10 Cricket A Gardening C
1. Display The Name Of Students Who Are Getting a Grade ‘C” In either
GAME OR Games2 OR Both.
2. Display The Name Of Students Who Have SAME Game For Both Game And
Game2.
3. Display The Games Taken By The Students, Whose Name Start With ‘A’

OUTPUT:-

Page 2 of 9
Q3. Given the Following Table Of Club:
Coach ID Coach Name Age Sports DateOFAPP PAY Gender
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 Ketki 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
1. To Show All Information About The Swimming Coaches In the Club.
2. To List Names Of All Coaches With Their Date Of Appointment(DateOFAPP)in
Decreasing Order.
3. To Display A Report Showing Coachname,Pay,age & Bonus(15% of Pay) for All
the Coaches.
OUTPUT:-

Page 3 of 9
Q4. Given the Following Table Of Club:
Coach ID Coach Name Age Sports DateOFAPP PAY Gender
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 Ketki 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

Give The Output of the Following code:


1. SELECT COUNT(DISTICT SPORTS) FROM CLUB;
2. SELECT MIN(AGE)FROM CLUB WHERE GENDER = ‘F’;
3. SELECT AVG(PAY) FROM CLUB WHERE SPORTS =’KARATE’;
4. SELECT SUM(PAY) FROM CLUB WHERE DAYEOFAP>’31/01/98’;

OUTPUT:-

Page 4 of 9
Q5. Write SQL Commands For The Following On The Basis Of Given Table
STUDENT : Part 1
No. Name STIPEND Stream Avg Mar Grade Class
1 Karan 400.00 Medical 78.5 B 12B
2 Divakar 450.00 Commerce 89.2 A 11C
3 Divya 300.00 Commerce 68.6 C 12C
4 Arun 350.00 Humanities 73.1 B 12C
5 Sabina 500.00 Non Medical 90.6 A 11A
6 John 400.00 Medical 75.4 B 12B
7 Robert 250.00 Humanities 64.4 C 11A
8 Rubina 450.00 Non Medical 88.5 A 12A
9 Vikas 500.00 Non Medical 92.0 A 12A
10 Mohon 300.00 Commerce 67.5 C 12C

1. Select all the Nonmedical stream students from STUDENT.


2. L i s t the n am e s o f th o s e s tu d ents who are in class 12 sorted by STIPEND.
3. List all students sorted by AvgMark in descending order.
4. Display a report, listing Name, Stipend, Stream and amount of Stipend
received in a year assuming that the Stipend is paid every month.

OUTPUT:-

Page 5 of 9
PART II
1. SELECT MIN(AvgMark) FROM STUDENT WHERE AvgMark < 75;
2. SELECT SUM (Stipend ) FROM STUD ENT WHERE Grade = 'B';
3. SELECT AVG(Stipend) FROM STUDENT WHERE Class = '12A';
4. SELECT COUNT(DISTINCT) FROM STUDENT ;

OUTPUT;-

Page 6 of 9
Q5. Write SQL commands for the following on the basis of given ‘LIBRARY’
Table:
N0 Title Authour Type PUB QTY Price
1. DATA STRUCTURE LIPSCHUTZ DS MCGRAW 4 217
2. COMPUTER STUDIES FRENCH FND GALGOTIA 2 75
3. ADVANCED PASCAL SCHILDT PROG MCGRAW 4 350
4. DBASE DUMMIES PALMER DBMS PUSTAKM 5 130
5. MASTERING C++ GUREWICH PROG BPB 3 295
6. GUIDE NETWORK FREED NET ZPRESS 3 200
7. MASTERING FOXPR SEIGAL DBMS BPB 2 135
8. DOS GUIDE MORTORN OS PHI 3 175
9. BASIC FOR BEGINNER MORTORN PROG BPB 3 40
10 MASTERING WINDOWS COWART OS BPB 1 225

1. Select All PROG Type Published By BPB From Library.


2. Display A List Of All Books With Price More Than 130 and Sorted By Qty.
3. Display all the books sorted by price in ascending order.

OUTPUT;-

Page 7 of 9
Q6. Write SQL commands for the following on the basis of given table MOV:

NO. TITLE TYPE RATING STARS QTY PRICE


1. Gone With The Mind Drama G Gable 4 39.95
2. Friday The 13 t h Horror R Jason 2 69.65
3. Top Gun Darma PG Cruise 7 49.95
4. Splash Comedy PG13 Hanks 3 29.95
5. Independence Darma R Turner 3 19.95
6. Risky Business Comedy R Cruise 2 44.95
7. Co c o o n Scifi PG Ameche 2 31.95
8. Crocodile Comedy PG13 Harris 2 69.95
9. 101 Dalmatians Comedy G 3 59.95
10. Tooties Comedy PG Hoffman 1 29.95
1. Display list of all movies with Price
a over 20 and sorted by price
2. Display a list of all movies with Price over 20 and sorted by price.
3. Display a report listing a movie number, current value and replacement
value for each movie in the above table. Calculate the replacement value
of all movies as: QTY * Price * 1.15.

OUTPUT;-

Page 8 of 9
Page 9 of 9

You might also like