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 ;
Join spelling mistake
ReplyDeleteOk 😁
DeleteFor b) it should be select name from teacher (not select * from teacher ) know...please refer and say
ReplyDeleteFor c) also...please check...
DeleteYes, You are right. I have corrected it : )
DeleteFor c) it will be select name, dateofjoin from teacher order by dateofjoin;
ReplyDeleteYes, You are right. I have corrected it : )
Delete:) :) :) :) :) :) :) :)
ReplyDelete: )
Deleteb) there is no Hindi Department then that's Error?
ReplyDeleteNo, It give Output with blank table.
Delete;):):):):):(:(:(:(:(:(:(
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )