What is the correct SQL statement to create a foreign key in the 'Orders' table that references the 'Customers' table's primary key? - Study24x7
Social learning Network
4 followers study24x7 19 Sep 2024 10:47 AM study24x7 study24x7

What is the correct SQL statement to create a foreign key in the "Orders" table that references the "Customers" table's primary key?

A

CREATE FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID)

B

ALTER TABLE Orders ADD CONSTRAINT fk_customer FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID)

C

ALTER TABLE Orders ADD FOREIGN KEY (CustomerID) REFERENCES Customers

D

CREATE TABLE Orders ADD FOREIGN KEY CustomerID REFERENCES Customers

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles