if the foreign key is in itself table, how to handle the first insertion problem.
/*外键是自己本身该如何处理插入问题*/
create table if not exists Course(
Cno varchar(10) primary key,
Cname varchar(100) not null,
Cpno varchar(10),
Ccredit tinyint,
foreign key (cpno) references course(cno)
);
/* the under sql will across error */
insert into Course(cno,cname,cpno,ccredit) value("1","数据库","5",4);
insert into Course(cno,cname,cpno,ccredit) value("2","数学",null,2);
insert into Course(cno,cname,cpno,ccredit) value("3","信息系统","1",4);
insert into Course(cno,cname,cpno,ccredit) value("4","操作系统","6",3);
insert into Course(cno,cname,cpno,ccredit) value("5","数据结构","7",4);
insert into Course(cno,cname,cpno,ccredit) value("6","数据处理",null,2);
insert into Course(cno,cname,cpno,ccredit) value("7","PASCAL语言","6",4);
enter image description here how can I initialize the table course with Mysql?