Question: 3. Sorting the Sales Data 1 > SET NOCOUNT ON; 3 4 Write a query to return just the user id and the order id


3. Sorting the Sales Data 1 > SET NOCOUNT ON; 3 4 Write a query to return just the user id and the order id in order of total items bought decreasing 5 6 Enter your query below. Please append a semicolon ";" at the end of the query */ 7 Final output should be a list of id and order id only. 8 9 go Schema 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 N Emily 3 Arthur TABLE_TWO id order_id total_items total_value 1 1 3 13.20 3 2 1 22.30 Expected output: name, amount
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
