Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

' 39. Write a query to display the department number and most recent employee hire date for each department. Sort the output by department number

image text in transcribed'

39. Write a query to display the department number and most recent employee hire date for each department. Sort the output by department number (Figure P7.39).

40. Write a query to display the employee number, first name, last name, and largest salary amount for each employee in department 200. Sort the output by largest salary in descending order, and then by employee number (Partial results shown in Figure P7.40).

41. Write a query to display the customer code, first name, last name, and sum of all invoice totals for customers with cumulative invoice totals greater than $1,500. Sort the output by the sum of invoice totals in descending order (Partial results shown in Figure P7.41).

42. Write a query to display the department number, department name, department phone number, employee number, and last name of each department manager. Sort the output by department name (Figure P7.42).

43. Write a query to display the vendor ID, vendor name, brand name, and number of products of each brand supplied by each vendor. Sort the output by vendor name and then by brand name (Partial results shown in Figure P7.43).

44. Write a query to display the employee number, last name, first name, and sum of invoice totals for all employees who completed an invoice. Sort the output by employee last name and then by first name (Partial results shown in Figure P7.44).

45. Write a query to display the largest average product price of any brand (Figure P7.45).

46. Write a query to display the brand ID, brand name, brand type, and average price of products for the brand that has the largest average product price (Figure P7.46).

47. Write a query to display the manager name, department name, department phone number, employee name, customer name, invoice date, and invoice total for the department manager of the employee who made a sale to a customer whose last name is Hagan on May 18, 2017 (Figure P7.47).

48. Write a query to display the current salary for each employee in department 300. Assume that only current employees are kept in the system, and therefore the most current salary for each employee is the entry in the salary history with a NULL end date. Sort the output in descending order by salary amount (Figure P7.48).

49. Write a query to display the starting salary for each employee. The starting salary would be the entry in the salary history with the oldest salary start date for each employee. Sort the output by employee number (Figure P7.49).

50. Write a query to display the invoice number, line numbers, product SKUs, product descriptions, and brand ID for sales of sealer and top coat products of the same brand on the same invoice. Sort the results by invoice number in ascending order, first line number in ascending order, and then by second line number in descending order (Figure P7.50).

51. The Binder Prime Company wants to recognize the employee who sold the most of its products during a specified period. Write a query to display the employee number, employee first name, employee last name, email address, and total units sold for the employee who sold the most Binder Prime brand products between November 1, 2017, and December 5, 2017. If there is a tie for most units sold, sort the output by employee last name (Figure P7.51).

52. Write a query to display the customer code, first name, and last name of all customers who have had at least one invoice completed by employee 83649 and at least one invoice completed by employee 83677. Sort the output by customer last name and then first name (Partial results are shown in Figure P7.52).

53. LargeCo is planning a new promotion in Alabama (AL) and wants to know about the largest purchases made by customers in that state. Write a query to display the customer code, customer first name, last name, full address, invoice date, and invoice total of the largest purchase made by each customer in Alabama. Be certain to include any customers in Alabama who have never made a purchase; their invoice dates should be NULL and the invoice totals should display as 0. Sort the results by customer last name and then first name (Partial result are shown in Figure P7.53).

FIGURE P7.27 THE CHOZ_LARGECO ERD LGCUSTOMER PK Cust Code LGBRAND PK Brand ID Brand_Name Brand_Type Cust_Fname Cust_Lname Cust_Street Cust_City Cust_State Cust_ZIP Cust_Balance includes plates LGPRODUCT LGLINE PK Prod SKU LGINVOICE PK Inv Num PK,FK1 Inv_Num | Line Num # contains appears on + FK2 FK1 Cust_code Inv_Date Inv_Total FK2 Employee_ID Prod_SKU Line_Qty Line Price Prod_Descript Prod Type Prod Base Prod_Category Prod_Price Prod_QOH Prod Min FK1 Brand_ID completes provided by LGEMPLOYEE PK Emp Num LGSALARY HISTORY LGSUPPLIES has # PK,FK1 Emp Num PK Sal From PK,FK1 Vend ID PK,FK2 Prod SKU Emp_Fname Emp_Lname Emp_Email Emp_Phone Emp_Hiredate Emp_Title Emp_Comm FK1 Dept_Num Sal End Sal_Amount provides manages employs I 70 LGVENDOR PK Vend ID LGDEPARTMENT PK Dept_Num Vend_Name Vend_Street Vend_City Vend_State Vend_ZIP Dept_Name Dept_Mail_Box Dept_Phone FK1 Emp_Num

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions

Question

=+b. a homeowner with a fixed-rate mortgage

Answered: 1 week ago

Question

LO6.1 Discuss price elasticity of demand and how it is calculated.

Answered: 1 week ago