Write an SQL query to list all product line product line names and, for each product line the product line ID, product line name the number of products and the average product price. Make sure to include all product lines separately

Assignment 4
Pine Valley Furniture Corporation

Answer the following questions are based on Problems and Exercises at the end of Chapter 6. (These questions refer to PVFC database that you used in Assignment 3):

1. Write an SQL query to list all product line product line names and, for each product line the product line ID, product line name the number of products and the average product price. Make sure to include all product lines separately.
2. Modify the query in Problem 1 to include only those product lines the average price of which is higher than $100.
3. List the employee names and number of employees he/she supervises (label this value No_of_Reportees) for each supervisor who supervises more than two employees.
4. Write an SQL query to list each customer ( customer ID and name) who bought at least one product that belongs to product line Basic in March 2018. List each customer only once.
5. Modify the query in Problem 4 so that you include the number of products in product line Basic that the customer ordered in March 2018.
6. Modify the query in Problem 5 so that the list includes the number of products in each customer bought in each product line in March 2018.
7. Display the salesperson name, product finish, and total quantity sold (label as Units_Sold) for each finish by each salesperson.
8. Display the customer ID, name, and order ID for all customer orders. For those customers who do not have any orders, include them in the display once.
9. Show the customer ID and name for all the customers who have ordered both products with IDs 3 and 4 on the same order.
10. List the IDs and names of all products that cost less than the average product price in their respective product lines.

======
If you have “dirtied” tables in PVFC database by making changes to table definitions or by adding, deleting or updating the rows, use the script below to deleted ALL tables from the schema.
The script is available as a .SQL file PVFC_Drop_All_Tables.sql under the tab Workshops & Databases

begin
for i in (select ‘drop table ‘||table_name||’
cascade constraints’ tbl from user_tables)
loop
execute immediate i.tbl;
end loop;
end;

With a clean schema run the script(s) to create tables in PVFC and populate them.

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
error: Content is protected !!