Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Customer (CustomerId, CustomerName) Employee (EmployeeId, EmployeeName, Salary, SupervisorId ) Product(ProductId, ProductName, ListPrice) Orders (OrderId, OrderDate, CustomerId , EmployeeId , Total) OrderedProduct ( OrderId , ProductId

Customer (CustomerId, CustomerName) Employee (EmployeeId, EmployeeName, Salary, SupervisorId) Product(ProductId, ProductName, ListPrice) Orders (OrderId, OrderDate, CustomerId, EmployeeId, Total) OrderedProduct (OrderId, ProductId, Quantity, Price) 

Write the code to complete the methods in OrderJDBC.java

Query1: Return the list of products that have not been in any order. Hint: Left join can be used instead of a subquery. 3 marks
Query2: Return the order ids and total amount where the order total does not equal the sum of quantity*price for all ordered products in the order. 3 marks
Query3: Return for each customer their id, name and average total order amount for orders starting on January 1, 2015 (inclusive). Only show customers that have placed at least 2 orders. 3 marks
Query4: Return the employees who have had at least 2 distinct orders where some product on the order had quantity >= 5. 4 marks

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

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

Psychological, financial, and career counseling.

Answered: 1 week ago

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago