1. Given the following table – CLUB
Give the output of following SQL statements:
(i) SELECT LCASE(SPORTS) FROM CLUB ;
Answer: Output
LCASE(SPORTS) |
karate |
karate |
squash |
basketball |
swimming |
swimming |
squash |
karate |
swimming |
basketball |
(ii) SELECT MOD(AGE, 5) FROM CLUB WHERE SEX = ‘F’ ;
Answer: Output
MOD(AGE,5) |
4 |
1 |
4 |
2 |
(iii) SELECT POWER(3,2) FROM CLUB WHERE SPORTS = ‘KARATE’ ;
Answer: Output
POWER(3,2) |
9 |
9 |
9 |
(iv) SELECT SUBSTR(COACHNAME, 1, 2) FROM CLUB WHERE DATOFAPP > ‘1998-01-31’ ;
Answer: Output
SUBSTR(COACHNAME,1,2) |
KA |
KE |
AN |
ZA |
SH |
2. Given the following table – STUDENT1
Give the output of following SQL statements:
(i) SELECT TRUNCATE(AvgMark) FROM Student1 WHERE AvgMark < 75;
Answer: Output
TRUNCATE(AvgMark) |
68 |
73 |
64 |
67 |
(Ii) SELECT ROUND(AvgMark) FROM Student1 WHERE Grade = ‘B’;
Answer: Output
ROUND(AvgMarks) |
79 |
73 |
75 |
(iii) SELECT CONCAT(Name, Stream) FROM Student1 WHERE Class = ’12A’;
Answer: Output
CONCAT(Name, Stream) |
RubinaNonmedical |
VikasNonmedical |
(iv) SELECT RIGHT(Stream, 2) FROM Student1 ;
Answer: Output
RIGHT( Stream, 2) |
al |
ce |
ce |
es |
al |
al |
es |
al |
al |
ce |