[Assignments] Simple Queries in SQL — Chapter 12 Assignments (Q/A)

|
Table of Contents

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

NoTitleTypeRatingStarsQtyPrice
1Gone with the WindDramaGGable439.95
2Friday the 13thHorrorRJason269.95
3Top GunDramaPGCruise749.95
4SplashComedyPG13Hanks329.95
5Independence DayDramaRTurner319.95
6Risky BusinessComedyRCruise244.95
7CocoonScifiPGAmeche231.95
8Crocodile DundeeComedyPG13Harris269.95
9101 DalmatiansComedyG359.95
10TootsieComedyPGHoffman129.95
Table : MOV
  1. Display a list of all movies with Price over 20 and sorted by Price.
  2. Display all the movies sorted by QTY in decreasing order.
  3. 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.
  1. SELECT * FROM MOV
    WHERE Price > 20
    ORDER BY Price ;
  2. SELECT * FROM MOV
    ORDER BY Qty DESC ;
  3. SELECT No as 'Movie Number', Price as 'Current Value', Qty * Price * 1.15 as 'Replacement Value'
    FROM MOV ;
"Spread the light within, illuminate the hearts around you. Sharing is not just an action, but a sacred journey of connecting souls."~ Anonymous

Leave a Reply

Your email address will not be published. Required fields are marked *