Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Fill in the blanks to complete the SQL statement below. A table called sales tracks revenue by year and quarter. (Each row represents quarterly sales

image text in transcribedimage text in transcribed

Fill in the blanks to complete the SQL statement below. A table called "sales" tracks revenue by year and quarter. (Each row represents quarterly sales in a given year.) The statement should create a new column called "year_over_year" that includes the "quarterly_sales" from a year earlier. (As an example, quarter 4 sales in 2022 would be compared to quarter 4 sales in 2021 .) Within the statement, in addition to this new column, include the year, quarter, and quarterly sales columns. Sort the data by the year and quarter in ascending order. SELECT year, quarter, quarterly_sales, FROM (quarterly_sales, ___ OVER (ORDER BY year, quarter) AS sales; Fill in the blanks to complete the SQL statement below. A table called "tickets" tracks the number of tickets sold each day at a movie theater. (Each row represents a different day.) The statement should create a new column called "tickets_yesterday" that includes the "tickets_sold" from the previous day. Within this statement, in addition to this new column, include the date_id and tickets_sold. Sort the data by the date_id in ascending order

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions