以student(sid,sname,birthday,sex)的查看為例。
【方式一】:desc student;
語法:desc 表名;---------------------用於查看表整體結構
【方式二】:describe student;
語法:describe 表名;---------------------用於查看表整體結構;
【方式三】:show columns from student;
語法:show columns from 表名;--------------------------用於查看表整體結構;
【方式四】:show create table student;
語法:show create table 表名;--------------------------用於查看表整體結構;
【方式五】:show full fields from student;
語法:show full fields from 表名;--------------------------------- 用於查看表整體結構;
【方式六】:show fields from student;
語法:show fields from 表名;----------------------------用於查看表整體結構;
【方式七】:desc student sname;
語法:desc 表名 成員名;--------------------------------用於查詢表中的一部分;
【方式八】:show index from student;
語法:show index from 表名;------------------------------------用於查看表局部結構;這種顯示不是很直觀,也不是可以完全顯示所有信息。
【方式八】:explain tablename;
語法:explain 表名;---------------------用於查看表整體結構;
摘抄自網上,已驗證