Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Filtering and Sorting Results based on Items Sold 1 > SET NOCOUNT ON; 3 4 Write a query to return the total items sold

image text in transcribedimage text in transcribed

4. Filtering and Sorting Results based on Items Sold 1 > SET NOCOUNT ON; 3 4 Write a query to return the total items sold for Peyton and Megan in that order 5 6 Enter your query below. Please append a semicolon ";" at the end of the query */ Final output should be name of user and total items sold for the 2 specified above. 7 8 Schema 9 go You are provided 2 tables: employees, sales. employees Name Type Description id INTEGER User ID name STRING Name of the employee sales Name Type Description id INTEGER User ID order_id INTEGER The unique ID for the order total_items INTEGER Total number of items within the order total_value DECIMAL Total value of the order Sample Data Tables TABLE_ONE id name 1 John 2 Emily 3 Arthur TABLE_TWO id order_id total_items total_value 1 1 3 13.20 3 2 2 1 22.30 Expected output: name, amount 4. Filtering and Sorting Results based on Items Sold 1 > SET NOCOUNT ON; 3 4 Write a query to return the total items sold for Peyton and Megan in that order 5 6 Enter your query below. Please append a semicolon ";" at the end of the query */ Final output should be name of user and total items sold for the 2 specified above. 7 8 Schema 9 go You are provided 2 tables: employees, sales. employees Name Type Description id INTEGER User ID name STRING Name of the employee sales Name Type Description id INTEGER User ID order_id INTEGER The unique ID for the order total_items INTEGER Total number of items within the order total_value DECIMAL Total value of the order Sample Data Tables TABLE_ONE id name 1 John 2 Emily 3 Arthur TABLE_TWO id order_id total_items total_value 1 1 3 13.20 3 2 2 1 22.30 Expected output: name, amount

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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

3rd Edition

0128012757, 978-0128012758

Students also viewed these Databases questions