content_image/774783.jpg
+------------+ | menagerie | +------------+ 

If you have not yet selected any database, the result is NULL . 

To find out what tables the default database contains (for example, when you are not sure about the name of a table), use this statement: 

mysql> SHOW TABLES; +---------------------+ | Tables_in_menagerie | +---------------------+ | event | | pet | +---------------------+ 

The name of the column in the output produced by this statement is always Tables_in_ db_name , where db_name  is the name of the database. See Section 13.7.7.39, “SHOW TABLES Statement” , for more information. 

If you want to find out about the structure of a table, the DESCRIBE  statement is useful; it displays information about each of a table’s columns: 

<img src='content_image/774783.jpg'>

Field  indicates the column name, Type  is the data type for the column, NULL  indicates whether the column can contain NULL  values, Key  indicates whether the column is indexed, and Default  specifies the column’s default value. Extra  displays special information about columns: If a column was created with the AUTO_INCREMENT  option, the value is auto_increment  rather than empty. 

DESC  is a short form of DESCRIBE . See Section 13.8.1, “DESCRIBE Statement” , for more information. 

You can obtain the CREATE TABLE  statement necessary to create an existing table using the SHOW CREATE TABLE  statement. See Section 13.7.7.10, “SHOW CREATE TABLE Statement” . 

If you have indexes on a table, SHOW INDEX FROM tbl_name  produces information about them. See Section 13.7.7.22, “SHOW INDEX Statement” , for more about this statement. 

## 3.5 Using mysql in Batch Mode 

In the previous sections, you used mysql  interactively to enter statements and view the results. You can also run mysql  in batch mode. To do this, put the statements you want to run in a file, then tell mysql  to read its input from the file: 

shell> mysql < batch-file 

If you are running mysql  under Windows and have some special characters in the file that cause problems, you can do this: 

