1.创建数据库,删除数据库,查询创建数据的语句,使用数据库,查询当前默认的数据库以及使用的编码方式校验规则。
[root@server ~]# mysql -uroot -p ------------登录mysql数据库
(1)创建数据库
(2)删除数据库
(3)查询创建的数据库
(4)使用数据库
(5)查询当前默认的数据库以及使用的编码方式校验规则
2.数字,文本,日期,在一章表中定义多个字段,要使用今天提到的所有的数据类型。
create table info(
id int(12) comment '编号',
company_name char(20) comment '公司名称',
introduction 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',
group1 tinyint comment '小组1成员人数',
group2 smallint comment '小组2成员人数',
group3 mediumint comment '小组3成员人数',
content5 int comment '内容5',
content6 bigint comment '内容6',
content7 float(3) comment '内容7',
content8 double comment '内容8',
content9 decimal(3) comment '内容9'
)engine=InnoDB default character set utf8mb4 collate utf8mb4_0900_ai_ci;