1.库的创建
    语法:
    create database [if not exists] 库名
    2.库的修改
    1.修改库名
    rename database 库名 to 新库名
    2.更改库的字符集
    alter database 库名 CHARACTER SET utf-8;

    3.库的删除
    drop database if exists 库名;

    4.表的创建
    create table if not exists 表名 (
    列名 数据类型(指定长度) 约束名
    。。。

    5.表的删除
    drop table if exists 表名

    6.表的修改
    1.修改表名
    alter table 表名 rename 【to】 新表名
    2.修改列名
    alter table 表名 change coloumn 旧列名 新列名 类型
    3.添加表、列级约束:
    ALTER TABLE t_admin MODIFY COLUMN id INT AUTO_INCREMENT;
    4.添加列
    alter table 表名 add coloumn 列名 类型 【frist|after 字段名】;

    8.表的复制
    1.复制表的结构
    create table 新表 like 旧表
    2.复制表的结构+数据
    create table 表名 select 查询列表 from 旧表

    image.png