mysql数据表案例-学习专用 mysql> create table if not exists `students`( -> `学号` int, -> `姓名` varchar(31) not null, -> `年龄` int not null, -> primary key(`学号`) -> )engine = InnoDB default charset=utf8; mysql> create table if not exists `course`( -> `课程编号` int, -> `课程名` varchar(20) not null, -> `学分` int not null, -> primary key(`课程编号`) -> )engine = InnoDB default charset=utf8; mysql> create table if not exists `choice`( -> `学号` int, -> `课程号` int not null, -> `成绩` int not null, -> primary key(`学号`) -> )engine = InnoDB default charset = utf8; mysql> show tables; +------------------+ | Tables_in_course | +------------------+ | choice | | course | | students | +------------------+ +-------+--------+------+ | 学号 | 姓名 | 年龄 | +-------+--------+------+ | 18143 | 肖梦瑶 | 18 | | 18172 | 艾珊珊 | 19 | +-------+--------+------+ +----------+------------------+------+ | 课程编号 | 课程名 | 学分 | +----------+------------------+------+ | 12333 | 概率论 | 3 | | 12356 | 数据库原理及应用 | 4 | +----------+------------------+------+ +-------+--------+------+ | 学号 | 课程号 | 成绩 | +-------+--------+------+ | 18143 | 12333 | 99 | | 18172 | 12356 | 88 | +-------+--------+------+