Question

Each question within deliverable 3 must begin on a new page and be sure to document the question as the title of each item at

If possible please just send the SQL statement. Thank you

Entities: CUSTOMER_t CustomerlD (PK) CustomerName CustomerStreet CustomerCity CustomerState CustomerZip CreditLimit SalesRepI

PRICE_HISTORY t ProductlD StartDate EndDate UnitPrice Composite Primary Key Composite Primary Key FABRICATED t ProductID Part

COURSE_T CourselD (PK) CourseDescription SALES_REPRESENTATIVE_T EmployeelD (PK), (FK) of EMPLOYEE t CommissionRate (hint: onl

1. Provide a list all of the Customer ID, Customer Names, and States and sort the list in alphabetical order by Customer Name

11. Provide an inventory report that lists the most costly items first. The inventory report should include product identific

21. Which customer purchased the overall largest dollar amount? Hint: One name and the total dollar amount only the result sh

Each question within deliverable 3 must begin on a new page and be sure to document the question as the title of each item at the top of each page. Also, using a 12-point font, include the SQL statement and then provide a screen shot of each query. The screen shots must include both the SQL statement and the results for each item below based on the data entered in task 1. The screen shots must be large enough for the instructor to clearly read the results without a magnifying glass! Caution: Read the instructions carefully! Each question is based on a single SQL statement, and the single SQL statement might contain sub-queries (additional SELECT statements) within the statement.
Entities: CUSTOMER_t CustomerlD (PK) CustomerName CustomerStreet CustomerCity CustomerState CustomerZip CreditLimit SalesRepID (FK) of SALES_REPRESENTATIVE_t ORDER_t OrderlD CustomerlD (FK) of CUSTOMER t CustomerPONumber This means the Customer Purchase Order Number) OrderDate DueDate ShipDate ORDER_LINE t OrderlD ProductID composite (PK), (FK) of PRODUCTt OrderQuantity composite (PK), (FK) of ORDER_t PRODUCT t ProductID (PK) ProductDescription StockQuantity this is the amount of the product we have in our warehouse. It is not provided in the data, so make up an arbitrary amount.
PRICE_HISTORY t ProductlD StartDate EndDate UnitPrice Composite Primary Key Composite Primary Key FABRICATED t ProductID PartID PartQuantity composite (PK), (FK) of PRODUCT_t.ProductID composite (PK), (FK) of PRODUCT_t.ProductID quantity of PartiD that goes into ProductID (example, 2 tires In one bicycle) PRODUCT_SUPPLIER t ProducID SupplierlD VendorPartID composite (PK), (FK) of PRODUCT t composite (PK), (FK) of SUPPLIERt this is the ID the Vendor (i.e., Supplier) uses in their system), similar to CustomerPONumber in the ORDER t ProductCost this is the amount we paid the Vendor for the product PurchasedQuantity SUPPLIER t SupplierlD (PK) SupplierName SupplierStreet SupplierCity SupplierState SupplierZip EMPLOYEE_t EmployeelD (PK) EmployeeFirstName EmployeeLastName EmployeeJobTitle EmployeeStreet EmployeeCity EmployeeState EmployeeZip EmployeeHireDate ManagerlD (FK) unary to EmployeeID EMPLOYEE COURSE_t EmployeelD composite (PK), (FK) of EMPLOYEE t CourselD composite (PK), (FK) of COURSE t CompletionDate
COURSE_T CourselD (PK) CourseDescription SALES_REPRESENTATIVE_T EmployeelD (PK), (FK) of EMPLOYEE t CommissionRate (hint: only employees with commission rates should be added to this table).
1. Provide a list all of the Customer ID, Customer Names, and States and sort the list in alphabetical order by Customer Name. 2. Provide a list of all of the Customer ID, Customer Names, and States, and sort the list by state with the Customer Names in alphabetical order within each state. 3. List the customers showing the Customer ID, Customer Name, address, and sales rep name in alphabetical order by customer name 4. Which employees have not completed course ID 90? Hint: name of employee only, and the best way to determine this is by having a subselect statement to determine the EmployeelDs that have completed CourselD 90, and then have a the select statement use the output of the subselect to determine which of all of the employees are not in the list provided by the subselect 5. How many sales reps does PSC have? Hint: I want to know how many, not who they are. Also, realize that all sales reps are employees, but not all employees are sales reps. Also, keep in mind that being a sales rep does not mean that they have actually sold anything 6. List all of the sales reps sorted by largest commission rate first Hint: name and sales commission rate 7. Who is the manager of the sales reps? Hint: name of the manger o 8. List the employee names of those that report directly to the manager of the sales reps. Hint: Your SQL statement will need to determine the manager first before it can determine the employees that report to him/her 9. Who is the manager of the manager of the sales reps? Hint: Show the name of the sales rep's manager's manager only, and your single SQL statement will need to determine the sales rep's manager before it can determine the manager of the sales rep's manager. 10. List the employee names of those that report directly to the manager of the sales manager. Hint: Your SQL statement must determine the sales manger before it can determine manager of the sales rep's manager, and then it must determine the names of those that report to the manager of the sales rep's manager.
11. Provide an inventory report that lists the most costly items first. The inventory report should include product identification numbers, product descriptions, unit prices, supplier names, cost, and quantity supplied. Hint: the most costly item is the one in which the product of cost and quantity yields the largest value. Be careful not to confuse cost with price. Price is the value that the products are sold to the customers, and cost is the value that is paid to purchase the products from the suppliers. Also, be aware that the word "product" above refers to the result of multiplication (i.e., the product of cost and quantity) 12. List all of the employees in alphabetical order and each course they have completed in order of date completed. Hint: some employees might not have taken any courses 13. List all of the products provided by each supplier in alphabetical order with the least expensive products shown first for each supplier. Hint: Be sure to include the Product ID, Product Description, Supplier ID, Supplier Name, Vendor Part #, and Cost. 14. Which sales representative has the highest dollar amount in total sales? Hint: Provide the name and the total sales amount for that rep only. Do not include the information for other people, and do not list details about orders. 15. List all of the sales reps and their total commission amounts in order of highest sales commission dollar amount first. Hint: Provide all of sales reps' names and their total commission dollar amounts- imagine that you were going to write one check to each sales rep to pay their total commission amount, so be sure to produce that dollar amount. Extra Hint: Not all of the sales reps have sold any orders. 16. Which sales representative has sold the most products? Hint: Name of the sales rep and a number representing the total number of distinct products sold by that rep. This is the number of different products they have sold, not the quantity of any products. 17. Which sales representative has generated the most profit for the company? Hint: Provide the name of the sales rep and the total profit amount only. This one SQL statement will have subqueries. You must determine the profitability of a product by subtracting its cost from its selling price and multiplying the difference by the quantity sold. Regarding the cost, many products are supplied by more than one suppler, and each supplier may provide a different cost, so when this occurs, use the least expensive cost in measuring your profitability 18. Provide a listing of all of the details for each order. The report must be organized by sales rep, then alphabetically by each customer for that sales rep, and then by each Order ID for that customer. The listing must include the Sales Rep's name, Customer Name, Order ID, Order Date, Due Date, Product ID Product Description, Quantity Purchased, and Unit Price 19. List the suppliers that provide hack saws, and sort the list with the lowest prices first. Hint: Your SQL statement must look for a "Hack Saw", and not some ProductID or PartID. Include the Supplier IDs, Supplier Names, Vendor Part #s, and cost. 20. Show the components and cost of materials for fabricating a hack saw. Hint: Your SQL statement must look for a "Hack Saw", and not some ProductID or PartiID. Include the ProductID (really PartID), Product Description, and Quantity Used for each component of a hack saw
21. Which customer purchased the overall largest dollar amount? Hint: One name and the total dollar amount only the result should be one record only 22. List the ProductIDs, product descriptions, and unit prices that are valid on July 14, 2019 for all products sorted by ProductlD. Hint: Search for prices valid on '19-JUL-2019'
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.

select CustomerId, CustomerName, CustomerState from Customer_t order by CustomerName;

2.

select CustomerId, CustomerName, CustomerState from Customer_t order by CustomerState, CustomerName;

3.

select CustomerId, CustomerName, CustomerStreet || ' ' ||CustomerCity || ' ' ||CustomerState|| ' ' ||CustomerZip as Address, EmployeeFirstName || ' ' || EmployeeLastName as 'Sales Rep Name' from Customer_t c, Employee_t e, Sales_Representative_t s where c.SalesRepId = s.EmployeeId and s.EmployeeId = e.EmployeeId order by CustomerName;

4.

select EmployeeFirstName || ' ' || EmployeeLastName from Employee_t where EmployeeId not in (select EmployeeId from Employee_Course_t where CourseID = 90);

5.

select count(*) from Sales_Representative_ t ;

Add a comment
Know the answer?
Add Answer to:
If possible please just send the SQL statement. Thank you Each question within deliverable 3 must begin on a new page and be sure to document the question as the title of each item at the top o...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please help me with this SQL Statement: Which sales representative has sold the most products? Hint: Name of the sales rep and a number representing the total number of distinct products sold by that...

    Please help me with this SQL Statement: Which sales representative has sold the most products? Hint: Name of the sales rep and a number representing the total number of distinct products sold by that rep. This is the number of different products they have sold, not the quantity of any products. There are two highest values so I cannot do SELECT Top 1. CUSTOMER_T CustomerID (PK) CustomerName CustomerStreet CustomerCity CustomerState CustomerZip CreditLimit SalesRepID (FK) of EMPLOYEE_T ORDER_T OrderID (PK) CustomerID...

  • Deliverable 1. Simple SQL Statements Caution: Read the instructions carefully! Each question is based on a...

    Deliverable 1. Simple SQL Statements Caution: Read the instructions carefully! Each question is based on a single SQL statement, and the single SQL statement might contain sub-queries (additional SELECT statements) within the statement. Provide a list all of the Customer ID, Customer Names, and States and sort the list in alphabetical order by Customer Name. Provide a list of all of the Customer ID, Customer Names, and States, and sort the list by state with the Customer Names in alphabetical...

  • Question for SQL in MS SQL Server Management Studio (Please don't use where clause for Joins...

    Question for SQL in MS SQL Server Management Studio (Please don't use where clause for Joins use from clause) Need to Create a Query because Northwind Traders has decided to increase their retail prices. Write a query that shows the product name, the current price, and the new price. Make sure the new price is listed to 2 decimal points. Follow below guidelines on new retail price: a.         If the category is beverages or dairy products, increase the price by...

  • can someone solve these quick please and thank you! sql chapter 4 Query #1: List the...

    can someone solve these quick please and thank you! sql chapter 4 Query #1: List the company name, contact name, contact title and the phone number for customers who HAVE NOT put in an order. Use an outer join. Query #2: Create a listing displaying the employee first name, last name and the full name (First name space Last Name) of the person they report to (Supervisor). This is a self-join. If an employee does not report to anyone then...

  • SQL queries and procedures TABLE: Employees Business Rules: EmployeeID is defined as the primary key. Address...

    SQL queries and procedures TABLE: Employees Business Rules: EmployeeID is defined as the primary key. Address has been denormalized to include City and State for performance reasons. DeptNbr is a foreign key that references DeptNbr in the Department table Manager is a foreign key that references EmployeeID in the Employees table Data Structure: (EmployeeId, LastName, FirstName, Street, City, State, Zip, DateOfHire, DateOfBirth, JobTitle, Salary, DeptNbr(fk), Manager(fk)) TABLE: Department Business Rules: DeptNbr is defined as the primary key. Data Structure: (DeptNbr,...

  • This is about database system. Thank you. Question A1 You are given with three Oracle tables,...

    This is about database system. Thank you. Question A1 You are given with three Oracle tables, namely, Program, Channel and Booking, as shown in Tables 1 to 3. PROGRAM_ID PROGRAM_NAME DURATION 2012022 Dragon Dance 2014063 Haunted House 2016005 CID 2017172 Kung Fu Master 2018322 Family Affair 2019006 Hong Kong Sites 2019113 2019 Singing Contest 25 58 45 28 68 120 75 Table 1: Program CHANNEL_NO CHANNEL_NAME TVR-1 Rediffusion Channel 1 TV-P Television Pearl Channel TV-G Television Gold Channel Table 2:...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT