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 ;

20 Comments

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

  1. Please check your d answer and give me a right answer

    ReplyDelete
  2. Last me underscore kyun lagaya

    ReplyDelete
    Replies
    1. It is not necessary you can also leave space.

      Delete
  3. A part ma non medical streams ja alawa streams ka sath print Karni haa code tho just ulta Kar Rahe ha

    ReplyDelete
  4. Why group by command is not use in part b

    ReplyDelete
  5. select* from student1 where stream!='medical' is it correct?

    ReplyDelete
  6. helped a lot
    thnx

    ReplyDelete
  7. Order by stipend mean

    ReplyDelete
    Replies
    1. Uske according complete table ko sort kar de ga

      Delete
  8. Uske according complete table ko sort kar de ga

    ReplyDelete
  9. [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.

    ReplyDelete

Post a Comment

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

Previous Post Next Post