Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Complete in SQL using netbeans Aggregate Functions Find the total of all payments made by each customer (98) Find the largest payment made by a

Complete in SQL using netbeans

image text in transcribed

image text in transcribed

image text in transcribed

Aggregate Functions

  1. Find the total of all payments made by each customer (98)
  2. Find the largest payment made by a customer (1)
  3. Find the average payment made by a customer (1)
  4. What is the total number of products per product line (7)
  5. What is the number of orders per status (6)
  6. List all offices and the number of employees working in each office (7)

Having

  1. List the total number of products per product line where number of products > 3 (6)
  2. List the orderNumber and order total for all orders that totaled more than $60,000.00. (3)

Computations

  1. List the products and the profit that we have made on them. The profit in each order for a given product is (priceEach buyPrice) * quantityOrdered. List the products name and code with the total profit that we have earned selling that product. Order the rows descending by profit. Only show those products whose profit is greater than $60,000.00. (11)
  2. List the average of the money spent on each product across all orders where that product appears when the customer is based in Japan. Show these products in descending order by the average expenditure (45).
  3. What is the profit per product (MSRP-buyprice). Order by productName. (110)
  4. List the Customer Name and their total orders (quantity * priceEach) across all orders that the customer has ever placed with us, in descending order by order total for those customers who have ordered more than $100,000.00 from us ordered by Customer total in descending order. (32)

No testing needed please I will do the testing

Services Tables CUSTOMERS AD CUSTOMERNUMBER CUSTOMERNAME CI CONTACTLASTNAME 0:1 CONTACTFIRSTNAME DJ PHONE CPL ADDRESSLINE1 BAL ADDRESSLINE 2 DJ CITY bSTATE I POSTALCODE 0:COUNTRY DJ SALESREPEMPLOYEENUMBER :) CREDITLIMIT Indexes Foreign Keys EMPLOYEES BPJ EMPLOYEENUMBER B. LASTNAME 6. FIRSTNAME DJ EXTENSION D. EMAIL OFFICECODE AL REPORTSTO JOBTITLE Indexes Foreign Keys OFFICES LED OFFICECODE DI CITY DI PHONE B. ADDRESSLINE1 CPL ADDRESSLINE2 1 STATE DA COUNTRY COD POSTALCODE B. TERRITORY Indexes ORDERDETAILS EL ORDERNUMBER DI PRODUCTCODE BEI QUANTITYORDERED OJ PRICEEACH BORDERLINENUMBER Indexes Foreign Keys ORDERS 0:1 ORDERNUMBER DI ORDERDATE W REQUIREDDATE 01 SHIPPEDDATE DJ STATUS LA COMMENTS LO CUSTOMERNUMBER Indexes Foreign Keys PAYMENTS Lil CUSTOMERNUMBER 6. CHECKNUMBER DU PAYMENTDATE AMOUNT Indexes Foreign Keys PRODUCTLINES J PRODUCTLINE b) TEXTDESCRIPTION DJ HTMLDESCRIPTION IMAGE Indexes PRODUCTS PRODUCTCODE 0 PRODUCTNAME PRODUCTLINE E PRODUCTSCALE D: PRODUCTVENDOR E PRODUCTDESCRIPTION DI QUANTITYINSTOCK W BUYPRICE 0 MSRP Indexes

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions

Question

What is linear transformation? Define with example

Answered: 1 week ago

Question

LO2 Explain the major laws governing employee compensation.

Answered: 1 week ago