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




(a) To show all information about the teacher of history department .

(b) To list the names of female teachers who are in Hindi department .

(c) To list names of all teachers with their date of joining in ascending order.


Answer =

(a)
Select * from Teacher
Where department = ‘History’ ;

(b)
Select name from Teacher
Where sex = ‘F’ and department =  ‘Hindi’ ;

(c)
Select name, dateofjoin from Teacher
Order by dateofjoin ;

12 Comments

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

  1. Join spelling mistake

    ReplyDelete
  2. For b) it should be select name from teacher (not select * from teacher ) know...please refer and say

    ReplyDelete
  3. For c) it will be select name, dateofjoin from teacher order by dateofjoin;

    ReplyDelete
    Replies
    1. Yes, You are right. I have corrected it : )

      Delete
  4. :) :) :) :) :) :) :) :)

    ReplyDelete
  5. b) there is no Hindi Department then that's Error?

    ReplyDelete
  6. ;):):):):):(:(:(:(:(:(:(

    ReplyDelete

Post a Comment

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

Previous Post Next Post