Determine the profit of ech book sold to Jake Lucas, using the actual price the
ID: 3695795 • Letter: D
Question
Determine the profit of ech book sold to Jake Lucas, using the actual price the customer paid (not the book's retail price). Short the results by order date. If more than one books was ordered, sort the results by profit amount in descending order. Perform the search using the customer name, not the customer number.
Note: Two SQL queries (Query 1: Using traditional approach. Query 2: Using the JOIN keyword) are needed for questions 5
This question is from Oracle 12c chapter 9 hands on assignment 5. Thank you >
I know it needs data to perfrom this task, but if anyone can explain how to do that, it would be great. Thank you again in advance!
Explanation / Answer
Using JOIN
Apply natural join on customers, orders, ordderitems & books table.Where Customer table contains details of customer and order ,orderitems table will contain details about order of books given by customer.
SELECT Title, PaidEach- AS Profit From CUSTOMERS natural join ORDERS natural join ORDERITEMS natural join BOOKS Where FirstName = 'Jake' AND LastName = 'Lucas' Order BY OrderDate, Profit;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.