For each order, list the order number, order date, item number, number of units
ID: 3673925 • Letter: F
Question
For each order, list the order number, order date, item number, number of units ordered, and quoted price for each order line that makes up the order. INNER JOIN
I have:
SELECT ORDERS.ORDER_NUM, ORDERS.ORDER_DATE, ITEM.ITEM_NUM,ORDER_LINE.NUM_ORDERED ,ORDER_LINE.QUOTED_PRICE, CUSTOMER.CUSTOMER_NUM, CUSTOMER_NAME
But I dont think thats right
Table Structure
Object Explorer Connect, Y dbo.CUSTOMER Columns CUSTOMER_NUM (PK, char(3), not null) CUSTOMER_NAME (char(35), not null) E STREET (char(20), null) E CTY (char(15), null) STATE (char(2), null) POSTAL CODE (char(5), null) BALANCE (decimal(8,2), null) CREDIT LIMIT (decimal(8,2), null) REP NUM (char(2), null) Keys Constraints Triggers Indexes Statistics dbo.ITEM Columns ITEM NUM (PK, char(4), not null) DESCRIPTION (char(30), null) ON HAND (decimal(4,0), null) CATEGORY (char(3), null) STOREHOUSE (chard), null) PRICE (decimal(6,2), null) Keys Constraints Triggers Indexes Statistics dbo.ORDER-LINE Columns ORDER_NUM (PK, char(5), not null) ITEM NUM (PK, char(4), not null) NUM-ORDERED (decimal(3,0), null) QUOTED-PRICE (decimal(6,2), null) Keys Constraints TriggersExplanation / Answer
The correct inner join query is given below:
here we need to do inner join between "orders" and "order_line" table
select orders.order_num, orders.order_date, order_line.item_num, order_line.num_ordered, order_line.quoted_price from orders INNER JOIN order_line on orders.order_num = order_line.order_num
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.