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.

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.

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)



Leave a Reply 3

Your email address will not be published. Required fields are marked *


CB

CB

1)Alter table STATES
2)Add constraint FK_StateCountry
3)Foreign key (Country_Abbr)
4)References COUNTRY (Country_Abbr)

krishtweety

krishtweety

agree

RW

RW

Agree CB and on the answer “Add Foriegn Key FK_StateCountry” is wrong however down below on the note have the correct answer.