首页 > Linux操作系统 > Linux操作系统 > FOREIGN KEY约束的创建
1.table level:
CREATE TABLE table1
(column_name1 type,
column_name2 type,
...
column_namen type,
CONSTRAINT constraint_name FOREIGN KEY (column_name)
REFERENCES table2(table2_column_name)
);
2.column level:
CREATE TABLE table1
(column_name1 type,
column_name2 type,
...
column_namen type
CONSTRAINT constraint_name REFERENCES table2(table2_column_name)
);
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/166189/viewspace-113546/ ,如需转载,请注明出处,否则将追究法律责任。