Tutorial by Examples

DESCRIBE and EXPLAIN are synonyms. DESCRIBE on a tablename returns the definition of the columns. DESCRIBE tablename; Exmple Result: COLUMN_NAME COLUMN_TYPE IS_NULLABLE COLUMN_KEY COLUMN_DEFAULT EXTRA id int(11) NO PRI 0 ...
An Explain infront of a select query shows you how the query will be executed. This way you to see if the query uses an index or if you could optimize your query by adding an index. Example query: explain select * from user join data on user.test = data.fk_user; Example result: id select_type...

Page 1 of 1