Answered step by step
Verified Expert Solution
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.
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 creditlimitStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started