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

I\'m using SQL, and the question is List the order number and order date for eac

ID: 3864338 • Letter: I

Question

I'm using SQL, and the question is List the order number and order date for each order that either was placed by Almondton General Store or that contains an order line for a Fire engine?

I put in the following code, but I keep getting an error that says "ORA-00933: SQL command not properly ended" I ran SQL plus from the command line and it appears to say that using the 'as' command is the problem. Im still not sure how that is an issue, though.

select distinct o.Order_NUM, o.Order_DATE
FROM ORDERS as o
inner join order_line as ol on ol.ORDER_NUM=o.ORDER_NUM
inner join item as i on i.ITEM_NUM=ol.ITEM_NUM
inner join customer as c on c.CUSTOMER_NUM=o.CUSTOMER_NUM
where i.DESCRIPTION='fire engine' or c.CUSTOMER_NAME ='almondton general store';

Any Help would be greatly appreciated.

Explanation / Answer

as is alias name used for attributes not table names

select distinct o.Order_NUM, o.Order_DATE FROM ORDERS o inner join order_line ol on ol.ORDER_NUM = o.ORDER_NUM inner join item i on i.ITEM_NUM = ol.ITEM_NUM inner join customer c on c.CUSTOMER_NUM = o.CUSTOMER_NUM where i.DESCRIPTION='fire engine' or c.CUSTOMER_NAME ='almondton general store';