Question

25. The president of the company wants a list of all orders ever taken. He wants...

25. The president of the company wants a list of all orders ever taken. He wants to see the customer name, the last name of the employee who took the order, the shipper who shipped the order, the product that was ordered, the quantity that was ordered, and the date on which the order was placed. [Hint: You will need to join the following tables: Customers, Employees, Shippers, Orders, OrderDetails, Products, and to get all of the necessary information.]

attempted solution:

SELECT customers.CustomerName, employees.LastName, shippers.ShipperName, products.ProductName, orders.Quantity, od.OrderDetails.date

FROM Customers, Employees, Shippers, Orders, OrderDetails, Products JOIN customers.customerID = orders.customerID AND employees.employeeID = orders.employeeID AND orders.ordersID = orderdetails.orderID AND orderdetails.shipperID = Shippers.shipperID AND Products.productID = OrderDetails.productID;

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Following is the updated Query for the above case.

SELECT customers.CustomerName, employees.LastName, shippers.ShipperName, products.ProductName, orders.Quantity, OrderDetails.date
FROM Customers INNER JOIN orders ON customers.customerID = orders.customerID
INNER JOIN employees ON employees.employeeID = orders.employeeID
INNER JOIN orderdetails ON  orders.ordersID = orderdetails.orderID
INNER JOIN shippers ON orderdetails.shipperID = Shippers.shipperID
INNER JOIN Products ON Products.productID = OrderDetails.productID;

Friend, That was a nice question to answer
If you have any doubts in understanding do let me know in the comment section. I will be happy to help you further.
Thanks

Add a comment
Know the answer?
Add Answer to:
25. The president of the company wants a list of all orders ever taken. He wants...
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
  • can someone solve these quick please and thank you! sql chapter 4 Query #1: List the...

    can someone solve these quick please and thank you! sql chapter 4 Query #1: List the company name, contact name, contact title and the phone number for customers who HAVE NOT put in an order. Use an outer join. Query #2: Create a listing displaying the employee first name, last name and the full name (First name space Last Name) of the person they report to (Supervisor). This is a self-join. If an employee does not report to anyone then...

  • 21. Your boss wants to know the total quantity of Boston Crab Meat that has ever...

    21. Your boss wants to know the total quantity of Boston Crab Meat that has ever been ordered. [Hint: You will have to join the OrderDetails and Products tables. Your WHERE clause should contain the criterion ProductName = "Boston Crab Meat", and you will have to use the SUM function in your SELECT clause.] SQL

  • The category name and a count of the number of products within each category. The listing...

    The category name and a count of the number of products within each category. The listing should be sorted by category name. A listing of the customer name, last name of employee who accepted the order, and the shipper for all orders from customers based in North America and shipped through either United Package or Federal Shipping. The listed must be sorted alphabetically by customer name. Please use https://www.w3schools.com/sql/

  • Wally's Widget Warehouse takes orders from 7 A.M. to 7 P.M. The manager wants to analyze the process and has provided t...

    Wally's Widget Warehouse takes orders from 7 A.M. to 7 P.M. The manager wants to analyze the process and has provided the process flow diagram shown below. There are three steps required to ship a customer order. The first step is to take the order from a customer. The second step is to pick the order for the customer and then they have to pack the order ready for shipping. Wally promises that every order placed today gets shipped tomorrow....

  • Below is the database schema for a company. Primary keys are underlined. Customers (CustomerID, CompanyName, Phone,...

    Below is the database schema for a company. Primary keys are underlined. Customers (CustomerID, CompanyName, Phone, BalanceDue) Oders (Orderid, orderdate, customerid, freightamount) Orderdetails (oderid, productid, qtyordered, price) Products (productid, productname, qtyinstock, suggestedprice, minstocklevel) Given this SQL statement: Select * From Customers Inner Join Orders on Orders.CustomerID=Customers.CustomerID Where Orders.CustomerID is Null; Which of the following statement is correct? It is a SQL select statement that will list the ProductName for all products where the Qtyinstock is less than the total QtyOrdered...

  • Identify the Entities and Attributes and Draw the ER diagram. 1. Consider a mail order database...

    Identify the Entities and Attributes and Draw the ER diagram. 1. Consider a mail order database in which employees take orders for parts from customers. The data requirements are summarized as follows: The mail order company has employees identified by a unique employee number, their first and last names, and a zip code where they are located Customers of the company are uniquely identified by a customer number. In addition, their first and last names and a zip code where...

  •    Prepare a design class diagram. A retail store wants to build an online system for...

       Prepare a design class diagram. A retail store wants to build an online system for their customer to place orders online and for pickup later from the store. Customers join the system by registering online (username (email), password, address, phone no) and including a credit card for use in online ordering; at that time they use login credentials (uername and password) to enter the online system. Customers who have joined the system can use the online system to search...

  • Create the following SQL Server queries that access the Northwind database Same as problem 3 but,...

    Create the following SQL Server queries that access the Northwind database Same as problem 3 but, limit the list to all customers who placed 3 or more orders. The product id, product name, last date that the product was ordered for all items in the Grains/Cereals category. (Hint: Use MAX) The product ID, product name, and number of distinct customers who ordered that product in 1996 Thank you. Categories Customers Employees Order Details Orders Products Shippers 9 CategoryID CategoryName Description...

  • uu Payments check Number paymentate amount customer Number Offices officeCode city phone addressLine1 addressLine2 state country...

    uu Payments check Number paymentate amount customer Number Offices officeCode city phone addressLine1 addressLine2 state country postalCode territory officeLocation # Customers customer Number customerName contactLastName contactFirstName phone addressLine1 addressLine2 city state postalCode country sales RepEmployeeNumber creditimit customer Location Employees employeeNumber lastName firstName extension email reports To job Title officeCode E Product Lines productline textDescription Orders order Number order Date requiredDate shipped Date status comments customerNumber Order Details orderNumber product Code quantity Ordered priceEach orderline Number Products product Code productName productScale...

  • Given the following relational database schema (primary keys are bold and underlined). Answer questions 2.1 to 2.4 Orde...

    Given the following relational database schema (primary keys are bold and underlined). Answer questions 2.1 to 2.4 Orders(orderld, customerld, dateOrdered, dateRequired, status) Customer(customerld, customerLastName, customerStreet, customerCity, customerState, customer Lip OrderDetails(orderld.productld, quantity, lineNumber, amount) Products(productld, name, description, quantity, unitPrice) Account(accountNumber, customerld, dateOpened, creditCard, mailingStreet, mailingCity, mailingState, mailingZip) 2.1 (2 Points) List all possible foreign keys. For each foreign key list both the referencing and referenced relations. 2.2 (2 Points) Devise a reasonable database instance by filling the tables with data of...

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
ADVERTISEMENT