Part6-向表中插入数据

一、场景如下

插入 insert:
1)向表class1插入数据

id = 1 ,uname = stu1 ,stu1 = 2020

id = 2 ,uname = stu2 ,stu1 = 2020
id=11,uname =stu3,sex=1

id=12,uname = stu4,sex=2 

id=13,uname =stu5,sex=1

id=14,uname = stu6,sex=2

2)向表studen1插入数据

id=4,stu_id=11,c_name=stu1,grade=90

id=5,stu_id=12,c_name=lin,grade=100

id=6,stu_id=33,c_name=istester,grade=20

 

二、实践如下

1)

insert into class1 (id,uname,stu1) values('2','stu2','2020');

insert into class1 (id,uname,sex) values('11','stu3','1');

insert into class1 (id,uname,sex) values('12','stu4','2');

insert into class1 (id,uname,sex) values('13','stu5','1');

insert into class1 (id,uname,sex) values('14','stu6','2');

 

 

 2)

insert into studen1(id,stu_id,c_name,grade) value('4','11','stu1','90');

insert into studen1(id,stu_id,c_name,grade) value('5','12','lin','100');

insert into studen1(id,stu_id,c_name,grade) value('6','33','istester','20');

 

 

用数据库查看表格

 

 

 

posted @ 2021-05-20 20:34  suesky  阅读(470)  评论(0编辑  收藏  举报