(Find all correct answers)
a) show indexes from sales; b) show columns from sales; c) describe sales; d) show create table sales\G e) mysqldump -d -p -u root tt sales < sales.sql f) select * from information_schema.columns where table_schema='TT' and table_name= 'sales' order by ordinal_position;
[ Tables and Indexes (15%) - Obtaining Table and Index Metadata ]
Answers:
a b c d e f
All of the listed techniques will provide metadata. From inside the mysql client you’ll usually use c and d. “Show indexes” can be useful, because it shows you the cardinality. A variation of e could be used to generate the create statements for a whole database. The information schema can be used to do analysis on metadata. Like for example checking, if all columns with the same name have the same type.