Q.Write SQL commands for the following on the basis of given table STUDENT1 :
(a) Select all the Nonmedical stream students from STUDENT1.
(b) List the names of those students who are in class 12 sorted by Stipend.
(c) List all students sorted by AvgMark in descending order.
(d) Display a report, listing Name, Stipend, Stream and amount of stipend received in a year assuming that the Stipend is paid every month.
Answer =
a.
select * from student1
where stream = “Nonmedical” ;
b.
select name from student1
where class like “12%”
order by stipend ;
c.
select * from student1
order by AvgMark desc;
d.
select name , stipend , stream , stipend * 12 as stipend_in_year from student1 ;
Please check your d answer and give me a right answer
ReplyDelete'd' is correct.
Deleteb is student1
ReplyDeleteOk, We have corrected it. : )
DeleteLast me underscore kyun lagaya
ReplyDeleteIt is not necessary you can also leave space.
DeleteA part ma non medical streams ja alawa streams ka sath print Karni haa code tho just ulta Kar Rahe ha
ReplyDelete????
DeleteWhy group by command is not use in part b
ReplyDeleteQuestion do not say to group the data.
Deleteselect* from student1 where stream!='medical' is it correct?
ReplyDeleteno
Deletefor non equality
Deleteuse <> instead of !=
!= not valid.
Deletehelped a lot
ReplyDeletethnx
Welcome : )
DeleteOrder by stipend mean
ReplyDeleteUske according complete table ko sort kar de ga
DeleteUske according complete table ko sort kar de ga
ReplyDelete[select name from student1 where class like “12%” order by stipend ; ] this command is not running I tried many times. please help me with this.
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )