Q. Given the following table:
Table: CLUB
| COACH_ID | COACHNAME | AGE | SPORTS | DATOFAPP | PAY | SEX |
|---|---|---|---|---|---|---|
| 1. | KUKREJA | 35 | KARATE | 1996-03-27 | 1000 | M |
| 2. | RAVINA | 34 | KARATE | 1998-01-20 | 1200 | F |
| 3. | KARAN | 34 | SQUASH | 1998-02-19 | 2000 | M |
| 4. | TARUN | 33 | BASKETBALL | 1998-01-01 | 1500 | M |
| 5. | ZUBIN | 36 | SWIMMING | 1998-01-12 | 750 | M |
| 6. | KETAKI | 36 | SWIMMING | 1998-02-24 | 800 | F |
| 7. | ANKITA | 39 | SQUASH | 1998-02-20 | 2200 | F |
| 8. | ZAREEN | 37 | KARATE | 1998-02-22 | 1100 | F |
| 9. | KUSH | 41 | SWIMMING | 1998-01-13 | 900 | M |
| 10 | SHAILYA | 37 | BASKETBALL | 1998-02-19 | 1700 | M |
Give the output of following SQL statements:
(i) SELECT LCASE (SPORTS) FROM Club;
(ii) SELECT MOD (Age, 5) FROM CLUB WHERE Sex = ‘F’;
(iii) SELECT POWER(3, 2) FROM CLUB WHERE Sports = ‘KARATE’;
(iv) SELECT SubStr (CoachName, 1, 2) FROM CLUB WHERE Datofapp > ‘1998-01-31’;
Answer =
(i)
Output:-
|
LCASE (SPORTS) |
|
karate |
|
karate |
|
squash |
|
basketball |
|
swimming |
|
swimming |
|
squash |
|
karate |
|
swimming |
|
basketball |
(ii)
Output:-
|
MOD (Age, 5) |
|
4 |
|
1 |
|
4 |
|
2 |
(iii)
Output:-
|
POWER(3, 2) |
|
9 |
|
9 |
|
9 |
As we know that 3 to power 2 is equal to 9 and there is 3 KARATE as sports.
(iv)
|
SubStr (CoachName, 1, 2) |
|
KA |
|
KE |
|
AN |
|
ZA |
|
SH |
In 4th ka will also come on basis of 3rd date according to table
ReplyDeleteWhat you want to say I can not understand.??
Delete????????????/
ReplyDeleteWhat you want to say I can not understand.??
DeleteNumber iv needs correction, the 3rd entry also has DATOFAPP>1998–01–31
ReplyDeleteOk 😁, I have corrected it.
DeleteIn the 4th option, Karan's name must also be included
ReplyDeleteOk 😁, I have corrected it.
DeleteCan you tell me how do you get the answers of part iii
ReplyDeleteAs you know that 3 to power 2 is equal to 9 and there is 3 KARATE as sports.
DeleteMod ka answer kaise aya? 35/5 wo 7 hua 4 kyu likha hua hai?
ReplyDeleteConsider the rows with sex=F
Delete35 kaha dikha apko
DeleteThere is 34
36
39 and 37
Can you explain the part 3
ReplyDeleteAs you know that 3 to power 2 is equal to 9 and there is 3 KARATE as sports.
DeleteIn (ii) last two outputs are interchanged please correct it
ReplyDeleteSorry, I have corrected it.
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )