1.SQL入门--库定义
1.1 DDL管理数据库-库定义
数据库定义语言
库名称 特性 字符集
表 名称 列
定义一个数据库,定义库名字
create database anyux;
定义一个表,定义表名称、及列属性
create table test(id int)
查看数据库
show databases;

show databases like 'tes%';

1.2 数据库定义名称及特性
指定字符集(校对规则collate)
一般默认值
create database anyux charset utf8;

collate
查看校对规则
show character set;

1.3 查看数据库定义语句
show create database anyux;

1.4.修改数据库字符集
alter database anyux charset gbk;

1.5 删除数据库
drop database anyux;

1.6 查看所在库
show database();

1.7查看当前登陆用户
select user();
