用sqlite.exe实现教材上的样例
在SC中用关联到Student和Course的外键同时作为主键
create table main.SC(
Grade int,
FOREIGN KEY(Sno_SC) references Student(Sno) primary key,
FOREIGN KEY(Cno_SC) references Course(Cno) primary key);
提示如下错误
Error: unknown column "Sno_SC" in foreign key definition
网上没有找到任何相关贴子, sqlite是不是不支持这么干?
那必须是支持的,不过 sqlite 有自己独特的写法: