1.创建数据库,删除数据库,查询创建数据的语句,使用数据库,查询当前默认的数据库以及使用的编码方式校验规则
创建了个名字叫one字符集是gbk collation是gbk_chinese_ci的数据库
删除数据库
drop database one_db;
查询创建one数据库执行的语句
使用first数据库
查询当前默认数据库
查看MySQL Server当前的Charset和Collation
2.数字,文本,日期
在一章表中定义多个字段,要使用今天提到的所有的数据类型
create table multi_tb(
id int(11) comment '编号',
company_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 '0705数据库IQ',
salary smallint comment '薪资',
five_plan mediumint comment '五年计划',
code_num bigint comment '代码量',
col1 float(20,4) default null,
temperature double(4,2) not null comment '温度',
col2 decimal(5,2) default null,
date1 date,
date2 datetime,
date3 timestamp,
date4 time,
date5 year(2)
)engine=InnoDB default character set utf8mb4 collate utf8mb4_0900_ai_ci;