Ditutup

Northwind database project

Using the Northwind database (table orders), write a single script (.sql file) that completes the following tasks:

1. Create a view showing every order that was shipped to Spain. Name the destination column "DestinationSpain". Include code that checks if the view already exists. If it does, it should be dropped and re-created.

2. Create another view that returns the name of each country and the number of orders shipped to that country. Name the number of orders column "NumOrders." Include code that checks if the view already exists. If it does, it should be dropped and re-created.

3. Have the script display all the rows from the first view.

4. Have the script display all the rows from the second view.

5. Finally, have the script display the total number of orders shipped to Spain. Name the column "TotalOrdersToSpain".

Complete the following tasks using the Northwind database (table Order Details):

1. Write a stored procedure named sp_insert_orderDetails that allows you to add a discount to an order. The stored procedure should accept five input parameters: OrderID, ProductID, UnitPrice, Quantity, and DiscountValue.

2. Have the stored procedure display all the orders with a discount, including the ones added by the stored procedure.

Complete the following tasks using the Northwind database (table orders):

Use the Orders table in the Northwind database to write a correlated subquery that displays the highest OrderID associated with each ShipCountry. This means the correlated subquery should display each country name and the Order with the highest OrderID. The results should be ordered by country name.

Kemahiran: Pemprosesan Data

Lihat lebih lanjut: northwind database project, northwind database, project northwind database, northwind database script, write view northwind, number orders shipped northwind, northwind sql project file, northwind view total orders, northwind project, database northwind country, project name northwind, northwind database details, northwind database tasks, correlated subquery northwind database, northwind database description, rows, project add, database no, project file, column already exists, added database, named, sql view table, project using sql, project complete

Tentang Majikan:
( 0 ulasan ) SaltLakeCIty, United States

ID Projek: #72074