Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5. Join + Aggregate Function 1 > SET NOCOUNT ON; 3 4 /* 5 Write a query that returns the name and total value of

image text in transcribedimage text in transcribed

5. Join + Aggregate Function 1 > SET NOCOUNT ON; 3 4 /* 5 Write a query that returns the name and total value of their sales for only the top seller. 6 Enter your query below. Please append a semicolon ";" at the end of the query */ 7 8 The final output should be one row of data with the name and total_value fields for the person with the highest total_value 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 Emily N 3 Arthur TABLE_TWO id order_id total_items total_value 1 1 3 13.20 3 3 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 with AI-Powered 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

Students also viewed these Databases questions