0% found this document useful (0 votes)
5 views

ANS-sql-qu & output-

The document contains a series of SQL queries and their expected outputs related to various database tables such as GAMES, faculty, GRADUATE, Sender, Recipient, and TRAINER. Each answer section provides specific queries to retrieve, insert, and manipulate data, along with the expected results or counts. The queries cover a range of operations including selection, aggregation, and ordering of data.

Uploaded by

sanjaisuri245
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)
5 views

ANS-sql-qu & output-

The document contains a series of SQL queries and their expected outputs related to various database tables such as GAMES, faculty, GRADUATE, Sender, Recipient, and TRAINER. Each answer section provides specific queries to retrieve, insert, and manipulate data, along with the expected results or counts. The queries cover a range of operations including selection, aggregation, and ordering of data.

Uploaded by

sanjaisuri245
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/ 2

ANS- SQL [Write the Query / write the output]

Answer-1
(i) SELECT GameName, Gcode FROM GAMES;
(ii) SELECT * FROM GAMES WHERE PrizeMoney>7000;
(iii) SELECT * FROM GAMES ORDER BY ScheduleDate;
(iv) SELECT SUM(PrizeMoney),Number FROM GAMES GROUP BY Number;
(v) 2
(vi) 19-Mar-2004 12-Dec-2003
(vii) 59000
viii) 101 103 108
Answer-2
(i) Select * from faculty where salary > 12000;
(ii) Select * from Courses.where fees between 15000 and 50000;
(iii) Select * from faculty fac, courses cour where fac.f_id = cour.f_id and fac.fname =
'Sulekha' order by cname desc;
(iv) 4
(vi) Amit Grid Computing
Rakshit Computer Security
Rashmi Visual Basic
Sulekha Human Biology
Answer-3.
a. SELECT NAME from GRADUATE where DIV = ‘I’ order by NAME;
b. SELECT NAME,STIPEND,SUBJECT, STIPEND*12 from GRADUATE;
c. SELECT SUBJECT,COUNT(*) from GRADUATE group by SUBJECT having
SUBJECT=’PHYISCS’ or SUBJECT=’COMPUTER SC’;
d. INSERT INTO GRADUATE values(11,’KAJOL’,300,’COMPUTER SC’,75,1);
e. (i) 63
(ii) 800
(iii) 475
(iv) 4
Answer-4
a. SELECT sendername from Sender where sendercity=’Mumbai’;
b. Select R.RecIC, S.Sendername, S.SenderAddress, R.RecName,
R.RecAddress from Sender S, Recepient R where
S.SenderID=R.SenderID ;
c. SELECT * from Recipent ORDER By RecName;
d. SELECT COUNT( *) from Recipient Group By RecCity;
e) SenderCity
Mumbai
New Delhi
f) A.SenderName
B.RecName R Jain H Singh
S Jha P K Swamy
g) RecName RecAddress
S Mahajan 116, A Vihar
S Tripathi 13, BID, Mayur Vihar
h) RecID RecName
ND08 S Mahajan
ND48 STripathi
Answer-5
(i) SELECT TNAME, CITY, SALARY FROM TRAINER ORDER BY HIREDATE;
(ii) SELECT TNAME, CITY FROM TRAINER
WHERE HIREDATE BETWEEN ‘2001-12-01’ AND ‘2001-12-31’;
(iii) SELECT TNAME,HIREDATE,CNAME,STARTDATE FROM TRAINER,
COURSE WHERE TRAINER.TID=COURSE.TID AND FEES<=10000;
(iv) SELECT CITY, COUNT(*) FROM TRAINER GROUP BY CITY;
(v) SELECT TID, TNAME, FROM TRAINER WHERE CITY NOT IN(‘DELHI’,’MUMBAI’);
(vi) TID TNAME
103 DEEPTI
106 MANIPRABHA
(vii) DISTINCT TID
101
103
102
104
105
(viii) TID Count(*)
Min(Fees) 101 2 12000
(ix) Count(*)
sum(Fees)
4 65000
============================================================================

You might also like