Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4991

Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4993
Question 21. How do you obtain table/index metadata? – MySQL Question of the Day

Skip to content

By urs in mysql questions

 
(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 ]
 

Tags: , ,

Comment Feed

One Response


  1. 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.
     

You must be logged in to post a comment.