Question: a) show the result of the SQL query. Write column headers in gray cells. DECLARE @max_Rating FLOAT= (SELECT MIN(Rating) FROM Movies) SELECT Title, Year,

a) show the result of the SQL query. Write column headers in gray cells. DECLARE @max_Rating FLOAT= (SELECT Movies Title Batman & Robin Spider-Man Monsters, Inc. Waterworld Titanic Troy Terminator 3 Dinosaur Stuart SELECT Title, Year, Rating, RANK() OVER (ORDER BY Rating DESC) AS Rank FROM Movies WHERE Year < 1999 ORDER BY c) SELECT Title, Year, Rating FROM (SELECT*, RANK() OVER (ORDER BY Rating DESC) AS Ranking FROM Movies) AS a d) SELECT Title, Length, Rating, Tile FROM (SELECT *, NTILE(4) OVER (ORDER BY Rating DESC) AS Tile FROM e) SELECT MPAA, COUNT(*) AS MovieCnt, CAST(SUM(Action)/COUNT(*) AS DECIMAL (3,2)) AS ActionPct FROM (SELECT e) SELECT MPAA, COUNT(*) AS MovieCnt, CAST(SUM(Action)/COUNT(*) AS DECIMAL (3,2)) AS ActionPct FROM (SELECT 

a) show the result of the SQL query. Write column headers in gray cells. DECLARE @max_Rating FLOAT= (SELECT MIN(Rating) FROM Movies) SELECT Title, Year, Rating FROM Movies WHERE Rating = @max_Rating Movies Title Batman & Robin Spider-Man Monsters, Inc. Waterworld Titanic Troy Terminator 3 Dinosaur Stuart Little Around the World in 80 Days Godzilla Pearl Harbor Year 1997 2002 2001 1995 1997 2004 2003 2000 1999 2004 1998 2001 Length Rating MPAA Genres 125 3.6 PG-13 Action 121 7.3 PG-13 Action 92 8 G Animation, Comedy 176 5.4 PG-13 Action, Drama 194 8 PG-13 Drama, Romance 162 Action, Drama, Romance 109 Action 82 81 120 133 184 7.1 R 6.9 R 6.3 PG 6 PG 5.7 PG 4.4 PG-13 5.4 R Animation Comedy Action, Comedy, Romance Action Action, Drama, Romance SELECT Title, Year, Rating, RANK() OVER (ORDER BY Rating DESC) AS Rank FROM Movies WHERE Year < 1999 ORDER BY Rank DESC c) SELECT Title, Year, Rating FROM (SELECT*, RANK() OVER (ORDER BY Rating DESC) AS Ranking FROM Movies) AS a WHERE Ranking = 1 d) SELECT Title, Length, Rating, Tile FROM (SELECT *, NTILE(4) OVER (ORDER BY Rating DESC) AS Tile FROM Movies) AS a WHERE Tile = 2 e) SELECT MPAA, COUNT(*) AS MovieCnt, CAST(SUM(Action)/COUNT(*) AS DECIMAL (3,2)) AS ActionPct FROM (SELECT *, CASE WHEN Genres LIKE '%action%' THEN 1.0 ELSE 0.0 END AS Action FROM Movies) AS a GROUP BY MPAA ORDER BY MPAA 3 e) SELECT MPAA, COUNT(*) AS MovieCnt, CAST(SUM(Action)/COUNT(*) AS DECIMAL (3,2)) AS ActionPct FROM (SELECT *, CASE WHEN Genres LIKE '%action%' THEN 1.0 ELSE 0.0 END AS Action FROM Movies) AS a GROUP BY MPAA ORDER BY MPAA 3

Step by Step Solution

3.40 Rating (144 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!