Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

My question is how do I write the SQL Querys for these problems? FIGURE P7.27 THE CH07_LARGECO ERD begin{tabular}{|l|l|} hline multicolumn{2}{|c|}{ LGCUSTOMER } hline

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

My question is how do I write the SQL Querys for these problems?

FIGURE P7.27 THE CH07_LARGECO ERD \begin{tabular}{|l|l|} \hline \multicolumn{2}{|c|}{ LGCUSTOMER } \\ \hline PK & Cust_Code \\ \hline & \( \begin{array}{l}\text { Cust_Fname } \\ \text { Cust_Lname } \\ \text { Cust_Street } \\ \text { Cust_City } \\ \text { Cust_State } \\ \text { Cust_ZIP } \\ \text { Cust_Balance }\end{array} \) \\ \hline \end{tabular} \begin{tabular}{|c|l|} \hline \multicolumn{2}{|c|}{ LGBRAND } \\ \hline PK & Brand ID \\ \hline & \( \begin{array}{l}\text { Brand_Name } \\ \text { Brand_Type }\end{array} \) \\ \hline \end{tabular} \begin{tabular}{|l|l|} \hline \multicolumn{2}{|c|}{ LGLINE } \\ \hline PK,FK1PK & \( \begin{array}{l}\text { Inv Num } \\ \text { Line_Num }\end{array} \) \\ \hline FK2 & \( \begin{array}{l}\text { Prod_SKU } \\ \text { Line_Qty } \\ \text { Line_Price }\end{array} \) \\ \hline \end{tabular} \begin{tabular}{|l|l|} \hline \multicolumn{2}{|c|}{ LGPRODUCT } \\ \hline PK & Prod_SKU \\ \hline & \( \begin{array}{l}\text { Prod_Descript } \\ \text { Prod_Type } \\ \text { Prod_Base } \\ \text { Prod_Category } \\ \text { Prod_Price } \\ \text { Prod_QOH } \\ \text { Prod_Min } \\ \text { Brand_ID }\end{array} \) \\ \hline \end{tabular} \begin{tabular}{|l|l|} \hline \multicolumn{2}{|c|}{ LGSUPPLIES } \\ \hline PK,FK1 & Vend ID \\ PK,FK2 & Prod SKU \\ \hline & \\ \hline & LGVENDOR \\ \hline PK & Vend ID \\ \hline & \( \begin{array}{l}\text { Vend_Name } \\ \text { Vend_Street } \\ \text { Vend_City } \\ \text { Vend_State } \\ \text { Vend_ZIP }\end{array} \) \\ \hline \end{tabular} Write a query to display the first name, last name, street, city, state, and zip code of any customer who purchased a Foresters Best brand top coat between 2017-7-15, and 2017-7-31. If a customer purchased more than one such product, display the customer's information only once in the output. Sort the output by state, last name, and then first name (Partial results shown in Figure P7.32). Figure P7.32 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). 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). Figure P7.51

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 Implementation

Authors: Shouhong Wang, Hai Wang

1st Edition

1612330150, 978-1612330150

More Books

Students also viewed these Databases questions

Question

What is Aufbau's rule explain with example?

Answered: 1 week ago

Question

2. To compare the costs of alternative training programs.

Answered: 1 week ago