-- 创建相同表命令
create table test like stu;
-- 给表增加列
alart table stu add qq varchar(20) NOT NULL COMMENT 'q';
-- 删除表列
alter table stu drop qq;
-- 创建视图和使用视图查询
create view student1990 as select stuId,name from student where year(birthday)=1990;
select * from student1990;
-- 通过information_schema查看数据库所有表
select * from information_schema.tables;
-- 数据库大小统计
select table_schema,SUM((AVG_ROW_LENGTH*TABLE_ROWS+INDEX_LENGTH))/1024
from information_schema.`TABLES`
where table_schema='hello'