Question: SQL - Write SELECT INTO statements to create two test tables named Customers and Orders that are complete copies of the Customers and Orders tables.
SQL
- Write SELECT INTO statements to create two test tables named Customers and Orders that are complete copies of the Customers and Orders tables. BUT FIRST code two DROP TABLE statements to delete Customers and Orders.
- Write and execute the following Select statement: Select * into CustomersUSA from Customers where 1=2 Please note that the statement above will create a new table with NO records in it since 1=2 is a condition that will never be true. This is a technique used to simply create a table structure from an existing table with no data. Now create an Insert statement that will select all USA customers from your Customers table and append them to CustomersUSA.
- Write a Delete statement that will remove all orders from Orders table where the Customer zipcode is from 12209. Since the zipcode is in the Customers table use a subquery or a join within the Delete statement
- Write a DELETE statement that deletes all orders from Orders table that had an order date within the range of 10/10/2016 and 10/25/2016 and shipped via United Package.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
