You have created a new table named Maintenance in the Hovercraft Rentals database. This table is located in the Chassis schema and has a HovercraftID column that is set to disallow null values. You want to create a relationship between the HovercraftID column in this new table and the HovercraftID column in the Inventory table, also located in the Chassis schema.

Which of the following Transact-SQL statements can you use to accomplish this goal?

 Posted by Rajkatie on 11/30/2012 | Category: Sql Server Interview questions | Views: 3599 | Points: 40
Select from following answers:
  1. ALTER TABLE Chassis.Maintenance ADD CONSTRAINT FK_HovercraftID FOREIGN KEY (HovercraftID) REFERENCES Chassis.Inventory (HovercraftID)
  2. ALTER TABLE Chassis.Maintenance ADD CONSTRAINT FK_HovercraftID PRIMARY (HovercraftID) REFERENCES Chassis.Inventory (HovercraftID)
  3. ALTER TABLE Maintenance.Chassis ADD CONSTRAINT FK_HovercraftID PRIMARY (HovercraftID) REFERENCES Inventory.Chassis (HovercraftID)
  4. All Above

Show Correct Answer


Source: Microsoft Press book | | Alert Moderator 

Comments or Responses

Login to post response