Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need Help on SQL Query 1.Find how many writer’s desks have been ordered. Give th

ID: 3871988 • Letter: N

Question

Need Help on SQL Query

1.Find how many writer’s desks have been ordered. Give the columns descriptive names.

2. Find how many tables (of any kind) Contemporary Casuals has ordered. Use descriptive column names.

Answer1:

Query2

Number of Writer's Desks

2

Answer2:

Query2

Num Tables

4

Query2

Number of Writer's Desks

2

Tables Customer t Customer-t Customer-address City State Postal code-Clck toAdd 32601 Customer I Customer name Casuals 1355 S. Hines Blvd Gainesville FL Plano Order line t 2 Value Furniture 3 Home Fumishings Eastern Furniture 15145 S.W. 17th St. 1900 Allard Ave. 1925 Beltline Rd 5585 Westcott Ct Carteret 07008 Sacramento CA Order line t Order-ID . ProductID , | Quantity-|Click to Add Order t 1001 Order ID Order Date customer ID Click to Add 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1002 10/21/2004 10/22/2004 10/22/2004 10/24/200 10/24/2004 10/27/2004 10/30/2004 11/5/2004 1004 1007 1008 Product t Product_IDPoduct_Description Prodt_Fin Standard_Price Product_Line_IdClick to Add 1009 1 End Table 2 Coffee Table 3 Computer Desk Natural Ash Natural Ash Natural $175.00 10001 200.00 20001 S375.00 20001 5 Writer's Desk 6 8-Drawer Dresser 7 Dining Table 8 Computer Desk 325.00 10001 $750.00 20001 White Ash Walnut Walnut $250.00 30001

Explanation / Answer

1.

Select count(Order_t.Order_ID) as "Number Of Writer's Desk" from Order_t inner join Order_line_t on Order_t.Order_ID = Order_line_t.Order_ID inner join Product_t on Order_line_t.Product_ID = Product_t.Product_ID where Product_t.Product_Description = 'Writer's Desk';

inner join on 3 tables is needed here

2.

Select count(Order_t.Order_ID) as "Num Tables" from Order_t inner join Customer_t on Order_t.Customer_ID = Customer_t.Customer_ID where Customer_t.Customer_name = 'Contemporary Casuals' and Product_t.Product_Description LIKE '%Table%;

Like operator is used for matching patterns

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote