PrepAway - Latest Free Exam Questions & Answers

You need to set up a rule that every STATE.Country_Abbr must match an existing record…

DRAG DROP
You have two existing tables, one named COUNTRY and the other named STATES.
The tables are defined as follows:

You need to set up a rule that every STATE.Country_Abbr must match an existing record in
the COUNTRY table.
Develop the solution by selecting and arranging the required code blocks in the correct
order.
You may not need all of the code blocks.

PrepAway - Latest Free Exam Questions & Answers

Answer: See the explanation

Explanation:
Box 1:

Box 2:

Box 3:

Box 4:

Note:
To allow naming of a FOREIGN KEY constraint, and for defining a FOREIGN KEY constraint
on multiple columns, use the following SQL syntax:
MySQL / SQL Server / Oracle / MS Access:
ALTER TABLE Orders
ADD CONSTRAINT fk_PerOrders

FOREIGN KEY (P_Id)
REFERENCES Persons(P_Id)

3 Comments on “You need to set up a rule that every STATE.Country_Abbr must match an existing record…


Leave a Reply