表 s 中的列status
和表spj中列qty 資料型別不一致導致;
修改如下:
DROP
TABLE dbo.SDROP TABLE pDROP TABLE j CREATE table s( sno
char(10)primary key, sname char(10)unique, status int );create table p(
pno char(10)primary key, pname char(10), color char(4), weight char(10)
);create table j( jon char(10)primary key, jname char(10), city char(10)
);create table spj( sno char(10), pno char(10), jno char(10), qty int,
primary key(sno,pno,jno), foreign key(sno)references s(sno), foreign
key(pno)references p(pno), foreign key(jno)references j(jon) );
表 s 中的列status
和表spj中列qty 資料型別不一致導致;
修改如下:
DROP
TABLE dbo.SDROP TABLE pDROP TABLE j CREATE table s( sno
char(10)primary key, sname char(10)unique, status int );create table p(
pno char(10)primary key, pname char(10), color char(4), weight char(10)
);create table j( jon char(10)primary key, jname char(10), city char(10)
);create table spj( sno char(10), pno char(10), jno char(10), qty int,
primary key(sno,pno,jno), foreign key(sno)references s(sno), foreign
key(pno)references p(pno), foreign key(jno)references j(jon) );