Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. Consider the following 3 tables below. Salesperson Customer ID Name Age Salary ID Name City Industry Type 1 Abe 161 140000 4 Samsonic pleasant
2. Consider the following 3 tables below. Salesperson Customer ID Name Age Salary ID Name City Industry Type 1 Abe 161 140000 4 Samsonic pleasant 2 Bob 34 44000 6 Panasung Joaktown 5 Chris 34 40000 7 Samony jackson 7 Dan 41 52000 9 Orange Jackson B 8 Ken 57 115000 I Joe 38 38000 Orders Number order date cust id salesperson id Amount 8/2/96 4 540 20 1/30/99 4 1800 7/14/95 9 40 1/29/98 7 2 2400 50 2/3/98 16 17 3/2/98 70 5/6/98 9 7 460 600 a) Write SQL query to find the order number and date of the orders that are not from Samsonic. Write SQL query in the box below [3 Marks) Write the resulting answer in the box below [2 marks] b) Write SQL query to find the ID of salespeople that have 2 or more orders. Write SQL query in the box below (3 Marks Write the resulting answer in the box below [2 marks] c) Write SQL query to find the name, age and salary of all the salespeople who have not placed an order. Write SQL query in the box below (3 Marks] Write the resulting answer in the box below [2 marks] d) Write SQL query to find out the total revenue amount generated in each year? Hint: Use GroupBy clause. Write SQL query in the box below [5 Marks]
Step 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