Question
Question 1 What is the primary key of the [Order Details] table? ProductID OrderID OrderID and ProductID There is no primary key. Question 2 Individually,
Question 1
What is the primary key of the [Order Details] table?
ProductID | ||
OrderID | ||
OrderID and ProductID | ||
There is no primary key. |
Question 2
Individually, what do the parts of the primary key for [Order Details] make?
Composite Keys | ||
Candidate Keys | ||
Foreign Keys | ||
Indexes |
10 points
Question 3
If you wanted to display a report showing all the Customers and the Products that they bought what tables would you have to navigate through in order to get all the information.
Go from Customers straight to Products | ||
Can't be done. | ||
Go from Customers to [Order Details] to Products | ||
Go from Customers to Orders to [Order Details] to Products |
Question 4
In the Employees table what does the self-pointing arrow mean?
That it is an alternate key. | ||
That a cross-join can easily be done on this table. | ||
This tells you that you have a self-referencing table as ReportsTo is a Foreign Key pointing to the EmployeeID which allows you to find all the employees who report to a particular manager. | ||
That the Employees table should be denormalized into two separate tables. |
Question 5
In the Employees table which columns cannot have a NULL value?
Photo | ||
Any column can contain NULL as long as it is a text field. | ||
EmployeeID | ||
EmployeeID, LastName, FirstName |
10 points
When you are searching on a Column that has a NULL value what statement should be used?
= NULL | ||
ISNULL() | ||
IS NULL | ||
You can't search for a NULL value only for empty spaces. |
Question 7
Go to Programmability folder under the Northwind database and right click on the Ten Most Expensive Products stored procedure. How are the top 10 products picked? Is there another way of doing this?
SET ROWCOUNT 10 or you can use TOP 10 within the SELECT statement. | ||
SET ROWCOUNT 10 or you can use TOP 10 within the WHERE statement. | ||
SET TOP10 or you can use ROWCOUNT 10 within the SELECT statement. | ||
RETURN FIRST 10 ROWS or you can use TOP 10 within the SELECT statement. |
Question 8
Look up the Insert statement. Write an Insert statement that would insert a row into the [Order Details] table.
INSERT INTO [Northwind].[dbo].[Order Details] ([OrderID] ,[ProductID] ,[UnitPrice] ,[Quantity] ,[Discount]) VALUES ('10248',50,2.41,2,.5) | ||
INSERT INTO [Northwind].[dbo].[Order Details] ([OrderID] ,[ProductID] ,[UnitPrice] ,[Quantity] ,[Discount]) VALUES (10248,50,2.41,2,.5) | ||
INSERT INTO [Northwind].[dbo].[Order Details] ([OrderID] ,[ProductID] ,[UnitPrice] ,[Quantity] ,[Discount]) VALUES (10248,50,2.41,2,null) | ||
INSERT INTO [Northwind].[dbo].[Order Details] ([OrderID] ,[ProductID] ,[UnitPrice] ,[Quantity] ,[Discount]) VALUES (10248,500,2.41,2,5) |
Question 9
Add in a new column to your Employee table called Pay. Make it a floating point numeric data type.
ALTER Employees ADD Pay datatype FLOAT | ||
ALTER TABLE [Employees] ADD Pay FLOAT | ||
ALTER Employees ADD Pay FLOAT | ||
ADD Pay FLOAT to Employees |
Question 10
Look up the Update statement. Write an Update statement that would increases the Pay of all employees who live in Cincinnati by 10%. That is same as multiplying by 1.10.
UPDATE [Employees] SET Pay *1.10 WHERE City ='Cincinnati' | ||
UPDATE [Employees] SET Pay = Pay *1.10 WHERE City ='Cincinnati' | ||
WHERE City ='Cincinnati' UPDATE Pay = Pay *1.10 FOR [Employees] | ||
UPDATE [Employees] LET Pay = Pay *1.10 WHERE City ='Cincinnati' |
Question 11
Look up the Delete statement. Write a Delete statement that would delete all Products where the ProductName = Widget.
DELETE FROM Products | ||
DELETE FROM Products WHERE ProductName ='Widget' | ||
DELETE FROM Products IF ProductName ='Widget' | ||
DELETE FROM Products WHERE ProductName ="Widget" |
Question 12
Go to the Views folder in SSMS. Look at the View called Summary of Sales by Quarter. What View does this view call.
Sales by Category | ||
Order Subtotals | ||
Current Product List | ||
Invoices |
Need help ASAP: Here is link http://www.schematodoc.com/NWWeb/Northwind_2007328229_ExpandedIndex.html
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started