create table `student`(
`id` int(11) not null auto_increment,
`name` char(50) not null comment '学生姓名',
`sid` int(11) not null comment '学号',
primary key(`id`),
unique key `sid`(`sid`)
)engine = innodb;
create table `course`(
`id` int(11) not null auto_increment,
`name` char(50) not null comment '课程名称',
`score` int(11) not null comment '成绩',
`sid` int(11) not null comment '学号',
primary key(`id`)
)engine = innodb; select student.name, course.name, course.score from student left join course on student.sid = course.sid
select student.name, course.name, course.score from student right join course on student.sid = course.sid
select student.name, course.name, course.score from student inner join course on student.sid = course.sid
select student.name, course.name, course.score from student cross join course where student.sid = course.sid