Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In SQL, write the query using the instructions and the model below: Retrieve a list of salespersons and the orders they have each facilitated, including

In SQL, write the query using the instructions and the model below:

Retrieve a list of salespersons and the orders they have each facilitated, including order ID,

order date, and order total. Each order facilitated by a salesperson contributes to their

total sales. Also provide the contribution of each order to the salesperson's total sales, as a

percentage of total sales. Round the percentage of total sales to two digits beyond the

decimal point using the 'round' function - round(#,2) where # is the number to round. The

query should output the salesperson name, order ID, order date, order total, and

percentage of salesperson total sales. Sort the list first in alphabetical order of salesperson

name, then by ascending order date, and then with larger order totals listed first.

image text in transcribed

FIGURE 2-22 Data model for Pine Valley Furniture Company in Microsoft Visio notation SALESPERSON TERRITOR SIN PK Salesperson ID Serves PK Territory ID Salesperson Name Salesperson Telephone Salesperson Fax Territory Name CUSTOMER PRODUCT LINE PK Customer ID PK Product Line ID Customer Name Customer Address Customer Postal Code Product Line Name Submits Includes ORDER PK Order ID Order Date DUC ORDER LINE PK Product ID Product Description Product Finish Product Standard Price Ordered Quantity VENDOR USES PRODUCED IN PK Vendor ID Vendor Name Vendor Address Goes Into Quantity RAW MATERIAL WORK CENTER PK Material ID PK Work Center ID Material Name Material Standard Cost Unit Of Measure Work Center Location Supply Unit Price ls Supervised By EMPLOYEE WORKS IN SupervisesPEmployee ID HAS SKILL SKILL Employee Name Employee Address PK Skill FIGURE 2-22 Data model for Pine Valley Furniture Company in Microsoft Visio notation SALESPERSON TERRITOR SIN PK Salesperson ID Serves PK Territory ID Salesperson Name Salesperson Telephone Salesperson Fax Territory Name CUSTOMER PRODUCT LINE PK Customer ID PK Product Line ID Customer Name Customer Address Customer Postal Code Product Line Name Submits Includes ORDER PK Order ID Order Date DUC ORDER LINE PK Product ID Product Description Product Finish Product Standard Price Ordered Quantity VENDOR USES PRODUCED IN PK Vendor ID Vendor Name Vendor Address Goes Into Quantity RAW MATERIAL WORK CENTER PK Material ID PK Work Center ID Material Name Material Standard Cost Unit Of Measure Work Center Location Supply Unit Price ls Supervised By EMPLOYEE WORKS IN SupervisesPEmployee ID HAS SKILL SKILL Employee Name Employee Address PK Skill

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 Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

3rd Edition

0760049041, 978-0760049044

More Books

Students also viewed these Databases questions

Question

Distinguish the difference between a prototype and a concept.

Answered: 1 week ago

Question

25.0 m C B A 52.0 m 65.0 m

Answered: 1 week ago