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
| create table testdb.student_card ( id int auto_increment comment '自增id' primary key, student_name varchar(32) null comment '学生姓名', student_id int null comment '学生id', money decimal default 0 not null comment '余额', create_time datetime null comment '创建时间' ) comment '学生卡';
create table testdb.students ( id int auto_increment comment '主键id' primary key, country varchar(32) null comment '国家', body_height int not null comment '身高(cm)', name varchar(48) null comment '名字', sex varchar(2) not null comment '性别', addr varchar(128) null comment '住址', weight int null comment '体重(kg)' ) comment '学生表';
INSERT INTO testdb.students (id, country, body_height, name, sex, addr, weight) VALUES (1, '中国', 163, '张云绮', '男', '安溪镇南朝大街114号', 52); INSERT INTO testdb.students (id, country, body_height, name, sex, addr, weight) VALUES (2, '中国', 152, '万雨', '女', '安乐村葫芦南路33号', 42); INSERT INTO testdb.students (id, country, body_height, name, sex, addr, weight) VALUES (3, '美国', 172, 'petter', '男', '南河别墅社区118号', 62);
|