1.查看数据库
show database;
2.创建数据库
create database unicom default charset utf8 collate utf8_general_ci
use unicom
3.创建表
create table tb2(id bigint not null auto_increment primary key,salary int,age tinyint)default charset=utf8;
4.新增数据
insert into tb2(salary,age) values(20000,28);
5.查询数据
select * from tb2
常用数据类型
整型
tinyint(-125到+125)、int、bigint
浮点型
float,double,decimal(8,2)8位,小数点后2位,精准小数
字符型
char(11):定长字符
varchar(11):真实多长按照多长存储
text:可存储65535个字符
datetime和date