Foreign keys are both a method of ensuring data integrity and a manifestation of the relationships between tables. When you add a foreign key to a table, you are creating a dependency between the table for which you define the foreign key (the referencing table) and the table your foreign key references (the referenced table).
The FOREIGN KEY constraint is used to prevent actions that would destroy links between tables.
create table orders
(
orderid int primary key,
orderdate datetime ,
employeeid int refrences employees(employeeid)
)
see more information plz visit
The FOREIGN KEY constraint is used to prevent actions that would destroy links between tables.
create table orders
(
orderid int primary key,
orderdate datetime ,
employeeid int refrences employees(employeeid)
)
see more information plz visit
No comments:
Post a Comment