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




(a) Display a list of all movies with Price over 20 and sorted by Price.

(b) Display all the movies sorted by QTY in decreasing order.

(c) Display a report listing a movie number, current value and replacement value for each movie in the above table. Calculate the replacement value for all movies as QTY * Price * 1.15.


Answer =

(a)
Select title from MOV
Where price > 20
Order by price ;

(b)
Select title from MOV
Order by QTY desc ;

(c)
Select no, price, qty* price * 1.15 as replacement_value from MOV ;

24 Comments

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

  1. (c)....from mov will be there..

    ReplyDelete
  2. are u the owner of path academy?

    ReplyDelete
  3. In (c) from where did no, price written �� ��

    ReplyDelete
    Replies
    1. I can't understand what you want say please tell me again.

      Delete
  4. very hlpfull...i use this every cs class

    ReplyDelete
  5. thank you sir

    ReplyDelete
  6. Excellent job I really appreciate your work ...love this website

    ReplyDelete
  7. (C) FROM is wrongly written as FORM.. please correct the error.

    ReplyDelete
  8. Thanks you ....just doing my assignment 😉

    ReplyDelete
  9. Sir 3rd wale mai na hamne replacement value ke beech mai _ lagyaa uska mtlb space? Agr uski jgh space likhenge ti ky hoga sir ?

    ReplyDelete
    Replies
    1. If you want to write space the you have to write "replacement value".

      Delete
  10. in first question why are we not using SELECT title instead of * ...as they are asking only the list of movies and not the whole information ?

    ReplyDelete
  11. Very helpful website loved it

    ReplyDelete
  12. title should have capital T i.e Title.Because we have to use the same field name

    ReplyDelete

Post a Comment

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

Previous Post Next Post