PrepAway - Latest Free Exam Questions & Answers

You need to modify the database design to meet the foll…

HOTSPOT
Note: This question is part of a series of questions that use the same scenario. For your convenience, the
scenario is repeated in each question. Each question presents a different goal and answer choices, but the text
of the scenario is exactly the same in each question in this series.
You have a database named Sales that contains the following database tables: Customer, Order, and
Products. The Products table and the Order table are shown in the following diagram.

The customer table includes a column that stores the data for the last order that the customer placed.
You plan to create a table named Leads. The Leads table is expected to contain approximately 20,000 records.
Storage requirements for the Leads table must be minimized.
You need to modify the database design to meet the following requirements:
Rows in the Orders table must always have a valid value for the ProductID column.
Rows in the Products table must not be deleted if they arepart of any rows in the Orders table.
All rows in both tables must be unique.
In the table below, identify the constraint that must be configured for each table.
NOTE: Make only one selection in each column.
Hot Area:

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:
A FOREIGN KEY in one table points to a PRIMARY KEY in another table. Here the foreign key constraint is put
on the ProductID in the Orders, and points to the ProductID of the Products table.
With a check constraint on the ProductID we can ensure that the Products table contains only unique rows.
http://www.w3schools.com/sql/sql_foreignkey.asp

7 Comments on “You need to modify the database design to meet the foll…

  1. 113 says:

    in my opinion, after my test , the answer are the two
    foreing key constraint .
    one constraint is in the Orders table: it must always have a valid value for the ProductID column.(foreing key from Order.ProductId to Products.ProductID)
    the other is in the Products table: it must not be deleted if they arepart of any rows in the Orders table: (foreing key between Orders.ProductName and Products.ProductName , it is possible to add a key constraint when the 2 columns have a unique constraint)




    3



    5

Leave a Reply