1. You are designing a database that will contain customer orders. Customers
will be able to order multiple products each time they place an order. You
review the database design, which is show below:
CustomerID OrderID ProductID
CompanyName ProductID Description
Address OrderDate UnitPrice
You want to promote quick response times for queries and minimize redundant
data. What should you do? (Each correct answer presents part of the
solution. Choose two)
A. Create a new order table named OrdersDetail. Add OrderID, ProductID, and
Quantity columns to this table.
B. Create a composite PRIMARY KEY constraint on the OrderID and ProductID
columns of the Orders table
C. Remove the ProductID and Quantity columns from the Orders table
D. Create a UNIQUE constraint on the OrderID column of the Orders table.
E. Move the UnitPrice column from the Products table to the Orders table.
2. You are a database developer for Proseware,Inc. You are implementing a
database for the database of the company\u2019s human resources department. This
database will store employee information. You create a table named
EmployeeContact that contains the following columns: HomePhone,
BusinessPhone, FaxNumber, and E-mailAddress.
A. Create a rule that disallows null values. Bind the rule to both the
HomePhone and BusinessPhone columns.
B. Create a rule that prevents null values from being entered into both the
HomePhone and BusinessPhone columns. Bind the rule to the table.
C. Add CHECK constraints on the HomePhone and BusinessPhone columns that
prevent null values from being entered into the columns.
D. Create a trigger that counts the number of items entered without a value
in the HomePhone column and then counts the number of items entered without
a value in the BusinessPhone column.
E. Configure the trigger so that if one or more rows are found that meet
these conditions, the trigger will cancel the data modification.
F. Add CHECK constraints on the HomePhone and BusinessPhone columns that
prevent null values from being entered into the HomePhone or BusinessPhone
reports of new answer 'F"
Orders Order Details Products Suppliers
OrderID OrderID ProductID SupplierID
CustomerID ProductID ProductName CompanyName
EmployeeID UnitPrice SupplierID ContactName
OrderDate Quantity CategoryID ContactTitle
SupplierDate UnitPrice City Region
ShipVia UnitsInStock PostalCode
Freight UnitsOnOrder Country
ShipName RecorderLevel Phone
You must ensure that the referential integrity of the database is
maintained. Which three types of constraints should you apply to your
design? (Each correct answer presents part of the solution. Choose three)
A. Create a FOREIGN KEY constraint on the Products table that references the
Order Details table
B. Create a FOREIGN KEY constraint on the Products table that references the
C. Create a FOREIGN KEY constraint on the Orders table that references the
Order Details table
D. Create a FOREIGN KEY constraint on the Order Details table that
references the Order table
E. Create a FOREIGN KEY constraint on the Order Details table that
references the Products table
F. Create a FOREIGN KEY constraint on the Suppliers table that references
the Products table
CREATE PROCEDURE get_sales_for_title
%title varchar(80), @ytd_sales int OUTPUT
SELECT @ytd_sales = ytd_sales
WHERE title = @title
IF @@ROWCOUNT = 0
You are creating a script that will execute this stored procedure. If the
stored procedure executes successfully, it should report the year-to-date
sales for the book title. If the stored procedure fails to execute, it
should report the following message:
\u201cNo Sales Found\u201d
A. DECLARE @retval int,
DECLARE @ytd int,
EXEC get_sales_for_title \u2018Net Etiquette\u2019, @ytd,
IF @retval < 0,
PRINT \u2018No sales found\u2019,
This action might not be possible to undo. Are you sure you want to continue?