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博客 ” ,链接:http://blog.itpub.net/166189/viewspace-113546/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/166189/viewspace-113546/