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

17 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. In 4th ka will also come on basis of 3rd date according to table

    ReplyDelete
    Replies
    1. What you want to say I can not understand.??

      Delete
  2. Replies
    1. What you want to say I can not understand.??

      Delete
  3. Number iv needs correction, the 3rd entry also has DATOFAPP>1998–01–31

    ReplyDelete
  4. In the 4th option, Karan's name must also be included

    ReplyDelete
  5. Can you tell me how do you get the answers of part iii

    ReplyDelete
    Replies
    1. As you know that 3 to power 2 is equal to 9 and there is 3 KARATE as sports.

      Delete
  6. Mod ka answer kaise aya? 35/5 wo 7 hua 4 kyu likha hua hai?

    ReplyDelete
    Replies
    1. Consider the rows with sex=F

      Delete
    2. 35 kaha dikha apko
      There is 34
      36
      39 and 37

      Delete
  7. Can you explain the part 3

    ReplyDelete
    Replies
    1. As you know that 3 to power 2 is equal to 9 and there is 3 KARATE as sports.

      Delete
  8. In (ii) last two outputs are interchanged please correct it

    ReplyDelete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post