Q. Write SQL commands for the following on the basis of given table GRADUATE:
(a) List the names of those students who have obtained Rank 1 sorted by NAME.
(b) Display a report, listing NAME, STIPEND, SUBJECT and amount of stipend received in a year assuming that the STIPEND is paid every month.
Answer =
(a)
Select name from GRADUATE
Where Rank = 1
Order by NAME ;
(b)
Select name ,stipend , subject , stipend * 12 as stipend_in_year from graduate ;
in (i) there should be display name not * . bcz it it asking for displaying name not all info
ReplyDeletenoooooooooooo
DeleteOk,
DeleteGreat work by you guys really very grateful for this
ReplyDeleteWelcome : )
DeleteIn 2 question after * why you have writen "12 as stipend_in_year"
ReplyDeleteI have multiply it with 12 for finding it for year.
Deletein q 2 there would be written as stipend*12 as "annual stipend" means in inverted comma as there is more than 2 word
ReplyDeleteI have written stipend_in_year , these are connect by _ (Underscore) so, it need not to use comma
DeleteGreat work by you guys really very grateful for this
ReplyDeleteWelcome : )
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )