Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

WHAT IS AUTOMATION TESTING?

Answered: 1 week ago

Question

What is Selenium? What are the advantages of Selenium?

Answered: 1 week ago

Question

Explain the various collection policies in receivables management.

Answered: 1 week ago