insert语句用法(sql数据库insert用法)

一、在class表中插入班级信息

INSERT INTO CLASS(CLASS_NAME) VALUE (‘一年级1班’);INSERT INTO CLASS(CLASS_NAME) VALUE (‘一年级2班’);INSERT INTO CLASS(CLASS_NAME) VALUE (‘一年级3班’);INSERT INTO CLASS(CLASS_NAME) VALUE (‘二年级1班’);INSERT INTO CLASS(CLASS_NAME) VALUE (‘二年级2班’);INSERT INTO CLASS(CLASS_NAME) VALUE (‘二年级3班’);INSERT INTO CLASS(CLASS_NAME) VALUE (‘三年级1班’);INSERT INTO CLASS(CLASS_NAME) VALUE (‘三年级2班’);INSERT INTO CLASS(CLASS_NAME) VALUE (‘三年级3班’);

insert语句用法(sql数据库insert用法)

数据插入完成后,查看表数据如下

二、在student表中插入学生信息

insert into student(NAME,SEX,BIRTH,CLASS_ID,ENROLLMENT_DATE) value(‘张三’,’1′,’1992-01-30′,’5′,’2019-09-01′);insert into student(NAME,SEX,BIRTH,CLASS_ID,ENROLLMENT_DATE) value(‘李四’,’2′,’1991-11-19′,’5′,’2019-09-01′);insert into student(NAME,SEX,BIRTH,CLASS_ID,ENROLLMENT_DATE) value(‘王麻子’,’1′,’1989-05-28′,’1′,’2020-09-01′);insert into student(NAME,SEX,BIRTH,CLASS_ID,ENROLLMENT_DATE) value(‘张晴’,’2′,’1993-05-30′,’2′,’2020-09-01′);

发表评论

登录后才能评论