a) show the result of the SQL query. Write column headers in gray cells. DECLARE @max_Rating...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Related Book For
Database management systems
ISBN: 978-0072465631
3rd edition
Authors: Raghu Ramakrishan, Johannes Gehrke, Scott Selikoff
Posted Date:
Students also viewed these databases questions
-
DewDrops has fallen on tough times, and they are looking to cut project costs to help make ends meet. They decide to outsource certain functions and cut back on the number of hours employees are...
-
Show the result of α-β pruning of the tree in Figure 10.76. Max Min Max Min
-
Use the table below to find: (fog)(-10) = (fof) (11) = X -10 f(x) -1 g(x) 4 -1 -7 -4 -7 11 (gof)(-4)= (gog)(7) = 4 7 15 4 7 -4 11 -4 15 7 -1 15 -10 -7 -10 11
-
A financial institution can borrow $100 million for 2 years at 3%. It plans to invest this money in a 1-year security with an interest rate of 4.8% per year. Calculate net interest income for the...
-
An ordinary flashlight uses two D-cell 1.5-V batteries connected in series as in Fig. 18-4b (Fig. 18-36). The bulb draws 450mA when turned on. (a) Calculate the resistance of the bulb and the power...
-
Lack of competitors in the market. Pressure from demanding customers and low-cost competition. Abundance of reliable suppliers. What is one of the challenges facing logistics and supply chain...
-
Jan Samson, CEO at CalleetaCO, sat staring at the now-empty boardroom. Her board of directors had reacted negatively to Jans growth proposals for expanding CalleetaCO globally, leaving Jan with a big...
-
Bracy Company acquired a new piece of construction equipment on January 1, 2011, at a cost of $100,000. The equipment was expected to have a useful life of 10 years and a residual value of $20,000...
-
Following your finalization of the preparation of Financial Statements of ABC PLC for the financial year ended 31 December 2021, you also have a task to undertake an analysis of these financial...
-
Spotlight Ltd has issued share capital of 60,000----8% redeemable cumulative preference shares of ~ 20 each and 4,00,000 equity shares of ~ 10 each. The preference shares are redeemable at a premium...
-
A three-year floating rate bond pays annual coupons of one-year Libor (set in arrears) and is floored at 3.000%. The Libor swap curve is as given in the below table (i.e, 1 year = 2.5000%, 2 year...
-
What are the major sources of conflict at work within the company at which you are employed? How do you think these conflicts may be resolved?
-
How does Maxs demand for snorkeling equipment change when the price of windsurfing equipment falls? What is Maxs cross elasticity of demand for snorkeling with respect to the price of windsurfing?...
-
During 2018, Jones transferred \(\$ 15,000\) cash and a building with an adjusted basis of \(\$ 50,000\) and a fair market value of \(\$ 90,000\) to Malibu Gardens Corporation in return for 90...
-
Gate Corp. acquired all of Way Corp's assets in a Type C reorganization on October 19, 2019. On the date of acquisition, Way Corp. had an unused net capital loss of $70,000. Gate Corp. had a net...
-
Are you a morning or an evening person? When did you first decide that you were one or the other? Has the fact that you are a morning, or an evening person affected your career decisions in any way?
-
1.) A supervisor's salary is an example of: A.) Direct labor. B.) Variable factory overhead. C.) A standard cost. D.) Fixed manufacturing costs. 2.) If the hourly wage rate actually paid during...
-
If M = 7, s = 2, and X = 9.5, what is z?
-
If you were about to create an index on a relation, what considerations would guide your choice? Discuss: 1. The choice of primary index. 2. Clustered versus unclustered indexes. 3. Hash versus tree...
-
What main conclusions can you draw from the discussion of the five basic file organizations discussed in Section 8.4? Which of the five organizations would you choose for a file where the most...
-
Explain the difference between Hash indexes and B+-tree indexes. In particular, discuss how equality and range searches work, using an example.
-
Vertical analysis would rarely be performed on which of the following statements or schedules? a. Income statement b. Adjusting entry worksheet c. Balance sheet d. All of the above are common targets...
-
To calculate the debt ratio, total liabilities should be divided by a. income from operations. b. total assets. c. interest expense. d. total stockholders equity.
-
Which ratio measures the ability of a company to pay its current debts? a. Current ratio b. Inventory turnover ratio c. Days sales in receivables d. Return on assets
Study smarter with the SolutionInn App