Question: Help with SQL Queries please! Q1: Using the classicmodels database and INNER JOINs, write SINGLE QUERY that displays ONLY the fields necessary to answer the

Help with SQL Queries please!

Q1: Using the classicmodels database and INNER JOINs, write SINGLE QUERY that displays ONLY the fields necessary to answer the following:

WHERE orderNumber = 10250

Produce ONE correct customerName

Q2: Use classicmodels;

Join only the tables necessary to create a query with a GROUP BY to aggregate the SUM of sales by customer for employeeNumber = 1611 (Andy Fixter)...Your SQL query should produce something similar to the following example:

customerNumber customerName TotalSales

528 ACME Supply co. 88844.12

714 Mildred's Models 55522.49

The TotalSales can be calculated by multiplying (quantityOrdered X priceEach) and can be named "TotalSales" by using the AS keyword.

You should order your output by TotalSales in DESCENDING order.

Q4: Using the classicmodels database, if you are given a productName and asked to display the customerName of all customers ordering the product, select the required tables you need to JOIN in order to complete the search?

a. orders

b. offices

c. customers

d. employees

e. orderdetails

f. products

g. productlines

h. payments

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!