数据库 1

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;

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值