--创建数据库
create database if not exists lyq;
--使用数据库
use lyq
--创建表
-- 课程表
create table if not exists course(course_id int,course_name string,teacher_id int);
-- 分数表
create table if not exists score(student_id int,course_id int,score int);
-- 学生表
create table if not exists student(student_id int,student_name string,student_birth string,student_sex string);
-- 教师表
create table if not exists teacher(teacher_id int,
teacher_name string
);
--插入数据
-- 课程表
insert into table course values
(01,‘语文‘,02),
(02,‘数学‘,01),
(03,‘英语‘,03);
-- 分数表
insert into table score values
(01,01,80),
(01,02,90),
(01,03,99),
(02,01,70),
(02,02,60),
(02,03,80),
(03,01,80),
(03,02,80),
(03,03,80),
(04,01,50),
(04,02,30),
(04,03,20),
(05,01,76),
(05,02,87),
(06,01,31),
(06,03,34),
(07,02,89),
(07,03,98);
-- 学生表
insert into table student values
(01,‘赵雷‘, ‘1990-01-01‘,‘男‘),
(02