alter table orderTips add constraint PK_order_movie foreign key (name) references movieContent(name); alter table orderTips add constraint PK_order_movie1 foreign key (name) references movieContent1(name); alter table ordertips add constraint PK_total unique key (name,name);错哪了
时间: 2023-06-10 10:03:41 浏览: 73
alter table 2.zip_ALTER_Table_csharp_sql
这段 SQL 语句有一些错误。首先,在第一个 alter table 语句中,应该将 "orderTips" 改为 "orderTips"。另外,在第二个 alter table 语句中,应该将 "ordertips" 改为 "orderTips"。最后,在第三个 alter table 语句中,应该将 "unique key" 改为 "unique"。正确的 SQL 语句应该如下:
alter table orderTips add constraint PK_order_movie foreign key (name) references movieContent(name);
alter table orderTips add constraint PK_order_movie1 foreign key (name) references movieContent1(name);
alter table orderTips add constraint PK_total unique (name, name);
阅读全文