Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Provide an SQL query for the following: A). Show total profit from orders placed by customers in each country. The query must return country and

Provide an SQL query for the following:

A). Show total profit from orders placed by customers in each country. The query must return country and total profit. Hint: Total profit is calculated by adding up values in profit column.

B). Show sales representative id, first, and last name as well as the number of orders placed by their customers. Hint: Remember that each row in orderinfo table represents a purchased item and each order can include multiple items.

image text in transcribedimage text in transcribedimage text in transcribed

salesrep Columns (5) repid repfirstname replastname phone i commission orderinfo Columns (14) id orderid i orderdate shipdate i shipmode customernumber i productid i category 1 subcategory productname unitprice i quantity discount profit customer Columns (13) i customernumber customername contactlastname i contactfirstname iphone addressline 1 i addressline2 city i state postal code country i salesrepemployeenumber creditlimit

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

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

0764532545, 978-0764532542

More Books

Students also viewed these Databases questions