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 ;
Q. accept a coach id and delete the record.
ReplyDeleteQ. display the table after deletion.
i= Delete from club where coach_id = 1 ;
Deleteii = Select * from club;
c) is misprinted:
ReplyDeletecorrect one:
mysql> select coachname , pay , age , pay * 0.15 as bonus from CLUB;
sql is not case sensitive. hence it is correct either way
Deletevery helpful
ReplyDelete😊😊
Deletevery helpful dude
ReplyDelete😊😊😊
Deleteto enter a row
ReplyDeleteYou have to write query again and again.
DeleteTHANK YOU SOOOO MUCH
ReplyDeleteWELCOME 😊
DeleteHelped Me Very Much
ReplyDeleteWelcome : )
Deletethanks brother
ReplyDeleteWelcome bro : )
DeleteIn c...as " bonus"...??? Is it correct to put inverted commas
ReplyDeleteNot necessary, because bonus is a single word.
DeleteWhat does as bonus from club do?
ReplyDeleteIt will be pay * 0.15
DeleteWill you provide java notes
ReplyDeleteWhat if we want to display date of appointment in ascending order
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )