Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part A ( Queries ) Save the queries as Query 1 , Query 2 . . . Note that you may need to modify the

Part A (Queries)
Save the queries as Query1, Query2... Note that you may need to modify the SQL view for some of these queries.
Design a query to list the ID, first name, and last name of employees who earn more salary than their supervisor and the amount by which the employee's salary is higher.
Design a query to enable the user to enter the name of a product and list the ID and product names of products having a different Quantity Per Unit from that of the product entered.
Design a query to enable the user to enter the first name and last name of an employee and list the ID, first name, last name, and hire date of all employees hired within two years after the employee entered was hired. For example, if the name entered was hired on March 20,2019, all employees hired from then up until March 20,2021, must be listed.
Design a query to list all Customer IDs, the Order ID of the orders they have submitted (if any), and the employee ID that handled the order. All employees (including those who have never handled an order) and all customer IDs (including those who have never submitted an order) must also be listed. The list must be ordered in ascending order of the employeeID, and then in ascending order of the orderiD (if the employee is listed more than once). A sample of the expected result from a different dataset is provided below: Customer ID ABCD has never submitted an order and employee ID 55 and employee ID 4 have never handled an order.
\table[[CustomerID,OrderiD,EmployeelD],[ABCD,,],[DCBA,11231,1],[DCBA,10101,2],[EBAC,11123,2],[,,4],[,,55]]
1
5. Design a query to list each product name, the number of units in stock for the product, and the total number of products that have the same units in stock as the product. The list must be in ascending order of the units in stock values and then in ascending order of the product name (if more than one product has the same units in stock). A sample of the expected result is provided below.
\table[[Product Name,Units In Stock,Products with Similar UnitsinStock],[Alice Mutton,0,5],[Chef Anton's Gumbo Mix,0,5],[Gorgonzola Telino,0,5],[Perth Pasties,0,5],[Thringer Rostbratwurst,0,5],[Sir Rodney's Scones,3,1],[Longlife Tofu,4,2],[Louisiana Hot Spiced Okra,4,2],[Rgede sild,5,1],[Northwoods Cranberry Sauce,6,2],[Scottish Longbreads,6,2],[dots,dots..,dots
image text in transcribed

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

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

How is the NDAA used to shape defense policies indirectly?

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago