首先mysql -uroot -p 进入MySQL
选择一个数据库使用,列如我使用的是 shouw databases; use sys
创建表格
create table homework_tb(
id int(11) comment '编号',
student_name char(6) comment '学生姓名',
introduce varchar(100) comment '介绍',
content1 tinytext comment '爱好1',
content2 text comment '爱好2',
content3 mediumtext comment '爱好3',
content4 longtext comment '爱好4',
description1 blob comment '描述1',
description2 mediumblob comment '描述2',
description3 longblob comment '描述3',
iq tinyint comment '0805数据库IQ',
age smallint comment '年龄',
three_plan mediumint comment '三年计划',
code_num bigint comment '代码量',
price float(8, 2) comment '学费',
book double(10, 2) comment '书本费',
total_amount decimal(10, 2) comment '总金额',
ruxueriqi date comment '入学日期',
start datetime comment '上课时间',
end_time time comment '下课时间',
ruxuenianfen year(4) comment '入学年份'
)engine=InnoDB default character set utf8mb4 collate utf8mb4_0900_ai_ci;
按回车
查看表格 输入show columns from homework_tb;
这样就完成了