mysql 日常操作-DDL

1 修改字段类型

  需求修改表字段类型

 alter table  表名    modify column 修改的字段(列名) 类型(修改的类型)

  ALTER TABLE sys_entry_item modify COLUMN name text; 

查询指定数据库中的表是空的或者不是空的

information_schema  看作是msql数据的信息数据库 存储了数据里面我们新建的数据库信息库里面的表信息等

table_schma  数据库表

table_rows  表的行数

select 表名[table_name] from infomation_schema.tables  where table_schma=数据库名  and table_rows=0

SELECT table_name from information_schema.TABLES where TABLE_SCHEMA='ris' and TABLE_ROWS!=0 

原文地址:https://www.cnblogs.com/lwdmaib/p/11909844.html