元数据是关于数据的数据
列出所有的 表
select table_name from information_schema.tables ;
列出所有的列。
select * from information_schema.columns
列出表的索引
show index from emp;
列出表约束
select a.table_name, b.constraint_name, b.column_name,a.constraint_type from information_schema.table_constraints a, information_schema.key_column_usage b where a.table_name =‘emp' and b.table_name = a.table_name;
约束是关系数据库的关键部分,要知道在表中有什么样的约束是理所当然的要求。
索引