Q. Write SQL commands for the following on the basis of given table CLUB :




(a) To show all information about the swimming coaches in the club.

(b) To list names of all coaches with their date of appointment (DATOFAPP) in descending order.

(c) To display a report, showing coachname, pay, age and bonus (15% of pay) for all the coaches.


Answer =

(a).

Select * from club
Where sports = “SWIMMING”  ;
 
(b).
Select coachname , datofapp from club
Order by datodapp desc ;
 
(c).
Select coachname , pay , age , pay * 0.15 as bonus from Club ;

22 Comments

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

  1. Q. accept a coach id and delete the record.
    Q. display the table after deletion.

    ReplyDelete
    Replies
    1. i= Delete from club where coach_id = 1 ;
      ii = Select * from club;

      Delete
  2. c) is misprinted:

    correct one:

    mysql> select coachname , pay , age , pay * 0.15 as bonus from CLUB;

    ReplyDelete
    Replies
    1. sql is not case sensitive. hence it is correct either way

      Delete
  3. very helpful

    ReplyDelete
  4. very helpful dude

    ReplyDelete
  5. to enter a row

    ReplyDelete
  6. THANK YOU SOOOO MUCH

    ReplyDelete
  7. Helped Me Very Much

    ReplyDelete
  8. thanks brother

    ReplyDelete
  9. In c...as " bonus"...??? Is it correct to put inverted commas

    ReplyDelete
    Replies
    1. Not necessary, because bonus is a single word.

      Delete
  10. What does as bonus from club do?

    ReplyDelete
  11. Will you provide java notes

    ReplyDelete
  12. What if we want to display date of appointment in ascending order

    ReplyDelete

Post a Comment

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

Previous Post Next Post