Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please turn in only one SQL file (or a .txt file) and submit it to the Assignment Submission Folder assigned for the homework. Answer the

image text in transcribed

image text in transcribed

Please turn in only one SQL file (or a .txt file) and submit it to the Assignment Submission Folder assigned for the homework.

Answer the following questions. Make sure you use comments in your SQL file to clarify/show which SQL statement is the answer to which question. The questions are:

  1. Write a query to show payments that each customer has made so far. Show Customer name, check number, and payment date
  2. Write a query to show orders made by each customer has made so far. Show Customer name, Order date, Required date, and Shipped date.
  3. Write a query to show the office location of each employee. Show employee's first and last name, addressline1, state, country.
  4. Write a query to show the name of the products for each order.
  5. Write a query to show the orderNumber, product name, and quantity ordered.
  6. Write a query to show the product code, product name, and image of the product line (join products and productlines).
  7. Write a query to show the customer number, payment amount, and order number (join three tables; orders, customers, and payments).
  8. Write a query to show the order number, customer number, and customers' city.
orders orderNumber INT order Date DATE requiredDate DATE shippedDate DATE status TEXT comments TEXT customer Number INT Indexes customers customer Number INT customer Name VARCHAR(255) contact, astName VARCHAR(255) contacFirstName VARCHAR(255) payments phone VARCHAR (255) ID INT addressLine1 VAROHAR (255) customerNumber INT addressLine2 VARCHAR(255) --- check Number VARCHAR(255) city VARCHAR(255) paymentDate DATE state VARCHAR(255) amount DOUBLE postal Code VARCHAR(255) Indexes country VAROMAR (255) salesRepEmployeeNumber INT credit. imit DECIMA.(3.2) Indexes products product Code VARCHAR(10) orderdetails productName TEXT ID INT orderNumber INT productLine VARCHAR(255) productScale TEXT product Code VARCHAR(10) quantityOrdered INT --IproductVendor TEXT product Descripton TEXT priceach DOUBLE quantityInStock INT orderlineNumber INT buyPrice DOUBLE Indexes MSRP DOUBLE Indexes productlines productLine VARCHAR(255) textDescription TEXT htmlDescription TEXT image TEXT Indexes offices officeCode INT city TEXT phone TEXT addressLine1 TEXT addressLine2 TEXTE state TEXT country TEXT postal Code TEXT territory TEXT Indexes employees employeeNumber INT lastName TEXT firstName TEXT extension TEXT emal TEXT officeCode INT reportsToTEXT jobTitle TEXT 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

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

ISBN: 321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

=+2 How does the preparation and support for each type of IE vary?

Answered: 1 week ago

Question

=+What is the extent of the use of each type of IE?

Answered: 1 week ago