Please write this SQL query using ORACLE DATABASE (USE ORACLE SYNTAX PLEASE, NOT
ID: 3664435 • Letter: P
Question
Please write this SQL query using ORACLE DATABASE (USE ORACLE SYNTAX PLEASE, NOT MYSQL OR MICROSOFT SQL).
Please make sure your query is ORACLE DATABASE SYNTAX and is correct and executes. If the query is written correctly than the my data in the cells shouldn't matter tha tI don't provide it; my database information however (the tables and columns) is located below the "Instructions."
Instructions:
Table and database information below
Link to database information if you can't see the image below: http://i.imgur.com/VwpcPmo.png
Thank you.
Explanation / Answer
DELETE FROM ORDERS WHERE ORDERID NOT IN(SELECT DISTINCT ORDERID FROM ORDERITEMS);