1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
| -- 学生表
create table `student` (
`id` int unsigned PRIMARY KEY auto_increment,
`name` char(32) not null unique,
`sex` enum('男','女') not null,
`city` char(32) not null,
`description` text,
`birthday` date not null default '1995-1-1',
`money` float(7,2) default 0,
`only_child` boolean
)charset=utf8mb4;
-- 学生数据
insert into `student`
(`name`,`sex`,`city`,`description`,`birthday`,`money`,`only_child`)
VALUES
('郭德纲', '男','北京','班长','1997/10/1',rand()*100,True),
('陈乔恩', '女', '上海', NULL, '1995/3/2', rand() * 100,True),
('赵丽颖', '女', '北京', '班花, 不骄傲', '1995/4/4', rand()* 100, False),
('王宝强', '男', '重庆', '超爱吃火锅', '1998/10/5', rand() *100, False),
('赵雅芝', '女', '重庆', '全宇宙三好学生', '1996/7/9',rand() * 100, True),
('张学友', '男', '上海', '奥林匹克总冠军!', '1993/5/2',rand() * 100, False),
('陈意涵', '女', '上海', NULL, '1994/8/30', rand() * 100,True),
('赵本山', '男', '南京', '副班长', '1995/6/1', rand() *100, True),
('张柏芝', '女', '上海', NULL, '1997/2/28', rand() * 100,False),
('吴亦凡', '男', '南京', '大碗宽面要不要?', '1995/6/1', rand() * 100, True),
('鹿晗', '男', '北京', NULL, '1993/5/28', rand() * 100,True),
('关晓彤', '女', '北京', NULL, '1995/7/12', rand() * 100,True),
('周杰伦', '男', '台北', '小伙人才啊', '1998/3/28', rand() *100, False),
('马云', '男', '南京', '一个字:贼有钱', '1990/4/1', rand()* 100, False),
('马化腾', '男', '上海', '马云死对头', '1990/11/28', rand()* 100, False);
成绩表
create table score (
`id` int unsigned primary key auto_increment,
`math` float not null default 0,
`english` float not null default 0
)charset=utf8mb4;
insert into score (`math`, `english`)
values
(49, 71), (62, 66.7), (44, 86), (77.5, 74), (41, 75),
(82, 59.5), (64.5, 85), (62, 98), (44, 36), (67, 56),
(81, 90), (78, 70), (83, 66), (40, 90), (90, 90);
|