Question

This code must be in SQL - Run the script provided with the assignment. This will...

This code must be in SQL -

Run the script provided with the assignment. This will create the tables used for this assignment. Write the necessary SQL commands to perform the required actions. Run the queries to obtain results from the database. (Make sure all columns returned have proper headings.)

3

  1. 2

    In a single row show the following values: how many unique manufacturers are in the products table. What is the most expensive price per unit in the products tables and the least expensive product in the products table.
  2. What is the average sales from sales reps who work from home?
  3. 2

    Show each Customer number and the total amount spent on Orders to date.

3

  1. Display each Sales Rep's Name followed by a count of how many customers they have.

3

  1. Show us the total amount of sales to date for each Product. Note that a Product is a combination of Manufacturer and Product. Please order your results by the largest total sales first.

4

  1. A Manufacturer has many products. (Example: ACI has around 7 different Products) Show us a listing of all the Manufacturers and a count of their products. NOTE: we do not care about products worth less than $0.50, remove those products from your counts. Additionally, we only want to see manufacturers if they have at least 4 different products.

4

  1. Using a non-correlated SUBQUERY, Show us the value of the highest credit limit between all customers of Sue Smith and Paul Cruz.

4

  1. Use a correlated SUBQUERY to solve this question. We want to see products that are selling well. Show us all of products (Mfr/Product) and their description. But only show us products where the total amount sold to date is more than 20 times the current price of a single product.

Example:
ACI 41002 is one of the products you should display because…
Price per unit is $0.76, 20 times that value is $15.20
The sum of all orders containing ACI 41002 is $48.64, which is larger than $15.20!

5

  1. Use a SUBQUERY and the key word EXISTS. Show all the Companies who have placed an order between January 1st, 2000 and January 1st, 2001
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Since you have not provided the table schema and column names, it is impossible for me to provide you correct working SQL Queries.

For time being, I am guessing the table and column names and providing you the queries. Hence, you might need to change the names accordingly in order to make them wrong. In case you need any help, reach out to me via comments section.

1. SELECT count(DISTINCT manufacturer), max(unitPrice), min(unitPrice) FROM Products;

2. SELECT avg(sales) FROM SalesRep WHERE work_location = 'Home';

3. SELECT CustNum, sum (amount) FROM Customer c JOIN Orders o ON c.CustNum = o.CustNum GROUP BY o.CustNum;

NOTE: As per Chegg policy, I am allowed to answer only 3 questions (including sub-parts) on a single post. Kindly post the remaining questions separately and I will try to answer them. Sorry for the inconvenience caused.

Add a comment
Know the answer?
Add Answer to:
This code must be in SQL - Run the script provided with the assignment. This will...
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
  • 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...

    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 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...

  • Using the below Relational Design from Oracle SQL data modeler, provide sql script for the following...

    Using the below Relational Design from Oracle SQL data modeler, provide sql script for the following queries (note please be sure to include "PART3.Table_name" when pulling info from specific tables) Query 6: How many orders are there by customer and what is the total sales and total profit sorted by customer’s total number of orders? Query 15: What is the total number of orders by shipping class? Query16: What are the monthly total sales from 2013 to 2014? Query 17:...

  • I can provide my log in to my teradata database if necessary. Thanks 19:31 P B...

    I can provide my log in to my teradata database if necessary. Thanks 19:31 P B . Ch. 6 HW Assignment 4 - Saved SG 59% Make db_pvfc11_big as your default database when you log into SQL Assistant: Username userid Password: Default Database: db pufc11_big Database Descriptions Provide proof of ownership by using Current_User attribute in all SELECT statements. Use the PVFC database to answer the following questions: 1. For each customer, list the CustomerID and the total number of...

  • Given the following relational schema, write queries in SQL to answer the English questions. The Access...

    Given the following relational schema, write queries in SQL to answer the English questions. The Access Database for the schema is available, as is a DDL file. It is also available on the MySQL server. You must only submit the SQL for your answers. You can get your answers without using a DBMS or by using Access or MySQL. Customer(cid: integer, cname: string, address: string, city: string, state: string) Product(pid: integer, pname: string, price: currency, inventory: integer) Shipment(sid: integer, cid:...

  • using SQL Assume the relations shown below (underlined attributes are primary and foreign keys): merchants(mid, name,...

    using SQL Assume the relations shown below (underlined attributes are primary and foreign keys): merchants(mid, name, city, state) products(pid, name, category, description) sell(mid, pid, price, quantity_available) orders(oid, shipping_method, shipping_cost) contain(oid,pid) customers(cid, fullname, city, state) place(cid, oid, order_date)   For each of the following questions write a SQL query: List names and sellers of products that are no longer available (quantity=0) List names and descriptions of products that are not sold. How many customers bought SATA drives but not any routers between 2009...

  • --* BUSIT 103                   Assignment   #3                       DUE DATE...

    --* BUSIT 103                   Assignment   #3                       DUE DATE : Consult course calendar                            /* You are to develop SQL statements for each task listed. You should type your SQL statements    under each task. You should always create an alias for any derived fields. Add a sort that makes    sense for each query. */ USE AdventureWorksLT2012; --1.   Build a single column of data in which...

  • MYSQL Applied Database I just want to make sure that the syntax looks okay for my...

    MYSQL Applied Database I just want to make sure that the syntax looks okay for my database SQL statements, any help would be much appreciated: 1.A query that asks for customer star review for Tony Stark on Opportunity Detail. SELECT CONCAT (employee_first_name,' ',employee_last_name) AS                            employee_name, review_star_count, FROM customer_reviews, JOIN e employees ON employee_id =employee_id, WHERE employee_id=4 AND opportunity_id=1; 2.A query that shows how many orders Additional Dot Twain License, in an order totaling over $900. SELECT product_name, COUNT(o.OrderID) AS...

  • Write an SQL query against the Chinook Database v1.4. Each query must run successfully using DB...

    Write an SQL query against the Chinook Database v1.4. Each query must run successfully using DB Browser for SQLite. Create the exact query below. Must use sub query. I saw that a similar solution for this question used IF and CONCAT functions which do not work and return errors. If it is possible to use the CASE function in place of IF that would be greatly appreciated. Also I really hate to ask but if it could be organized neatly...

  • * myCompany.SQL Introduction to SQL Script file for ORACLE DBMS This script file creates the following...

    * myCompany.SQL Introduction to SQL Script file for ORACLE DBMS This script file creates the following tables: VENDOR, PRODUCT, CUSTOMER, INVOICE, LINE EMPLOYEE and loads the default data rows */ set echo on; set serveroutput on; select systimestamp from dual; show user; ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY'; DROP TABLE LINE CASCADE CONSTRAINTS; DROP TABLE INVOICE CASCADE CONSTRAINTS; DROP TABLE CUSTOMER CASCADE CONSTRAINTS; DROP TABLE PRODUCT CASCADE CONSTRAINTS; DROP TABLE VENDOR CASCADE CONSTRAINTS; DROP TABLE EMPLOYEE CASCADE CONSTRAINTS; CREATE TABLE...

  • Use SQL to slove the problem 1. (7) List all condos in building C, the date...

    Use SQL to slove the problem 1. (7) List all condos in building C, the date they were cleaned, and the full name of the staff who cleaned them in August. 2. (5) Display the activities reserved in June for more than 3 people. Include the activity description and label the output as Activities Reserved in June. 3. (4) Listing for all guides and their certification renewal dates for next year. Include full name and hire date. 4. (6) Management...

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