1. -- 修改表名
    2. ALTER table test rename tests;
    3. rename table tests to test
    4. -- 修改表字符集
    5. alter table test charset gbk
    6. -- 清空表数据 逐条进行删除比较慢
    7. delete FROM test
    8. -- 清空表 比较快
    9. TRUNCATE test
    10. -- 删除表
    11. drop table if exists test
    12. -- 修改字段属性
    13. alter table test modify brandName varchar (150) null
    14. -- 修改字段名称
    15. alter table test change brandName bName varchar (100) not null
    16. -- 添加字段并且制定字段位置 只能放字段的后面 或者最前面
    17. alter table test add made varchar (100) default null after description
    18. -- 添加到最前面
    19. alter table test add g_size varchar (50) default null first
    20. -- 删除字段
    21. alter table test drop g_size
    22. -- 删除主键
    23. alter table test modify id int not null
    24. alter table test drop primary key
    25. -- 添加主键
    26. alter table test add primary key (id)
    27. -- 添加自增列和主键一起
    28. alter table test modify id int auto_increment, add primary key (id)