求助数据库表中内容的插入问题

create table Student
(
    Sno CHAR(9)primary key,
    Sname char(20)unique,
    Ssex char(2),
    Sage smallint,
    sdept char(20)
)

create table Course
(
    Cno char(4) primary key,
    Cname char(40) not null,
    Cpno char(4),
    Ccredict smallint,
    foreign key(Cpno)references Course(Cno)
)

create table SC
(
    Sno char(9),
    Cno char(4),
    Grade smallint,
    primary key(Sno,Cno),
    foreign key(Sno)references Student(Sno),
    foreign key(Cno)references Course(Cno)
)

insert into SC (Sno,Cno,Grade)
select 20121521,1,92 union
select 20121521,2,85 union
select 20121521,3,88 union
select 20121522,2,90 union
select 20121522,3,80
select*from SC

出现以下提示
INSERT 语句与 FOREIGN KEY 约束"FK__SC__Sno__239E4DCF"冲突。该冲突发生于数据库"DB1",表"dbo.Student", column 'Sno'。

求问该如何修改

建议你把SC表中的Sno和Cno换个名称

数据长度是8,表中char(9)改成char(8),既然是外键,外键表中得有对应的数据

SC 这个表有外键约束,你得确认你插入的数据在其他两个约束表中出现过才行。