Question: SQL:NORTHWIND Query#1: Write SELECT INTO statements to create two test tables named Customers and Orders that are complete copies of the Customers and Orders tables.

SQL:NORTHWIND

Query#1: 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.

Query#2. Write an INSERT statement that adds a row to the Customers table with the following values:

CustomerID: HTTP

CompanyName: Jedds Woods

ContactName:

ContactTitle: student

Student Address: 6541 Prescott Rd.

City: Carson

Region: CA

PostalCode: 50124

Country: USA

Phone: (248) 555-5555

Fax: Null

Query#3. 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.

Query#4. Write an UPDATE statement that modifies the Orders table. Change the employee id field from 4 to 6 for orders that have an order date of 7/19/2016.

Query#5. Write an UPDATE statement that modifies the Customers table. The customer with a customer ID of THEBI has been bought out by another company. Please write an update statement to modify the following values for this customer: Company Name: All Four Cheeses Contact Name: Aaron Rogers Contact Title: Owner New Phone#: (503) 555-1234 Fax#: (503) 555-5678

Query#6. Write an UPDATE statement that modifies the Orders table. Modify the ShippedDate field to add 3 more days to the current shipped date using the DateAdd function for orders where the customer is located in the country of Germany. YOU MUST use the following subquery example: Update Orders Set Where CustomerID In(Select CustomerID from Customers Where.).

Query#7. 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.

Query#8. 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.

Query#9. Write a DELETE statement for the Customers table. Delete the customers that have not put in any orders. YOU MUST use a subquery and the EXISTS operator to perform this task.

Query#10. Delete ALL the records from the CustomersUSA table.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!