Database Reference
In-Depth Information
Output
+-----------------------+
| Tables_in_crashcourse |
+-----------------------+
| customers |
| orderitems |
| orders |
| products |
| productnotes |
| vendors |
+-----------------------+
Analysis
SHOW TABLES; returns a list of available tables in the currently selected
database.
To show a table's columns, you can use DESCRIBE :
Input
DESCRIBE customers;
Output
+--------------+-----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+-----------+------+-----+---------+----------------+
| cust_id | int(11) | NO | PRI | NULL | auto_increment |
| cust_name | char(50) | NO | | | |
| cust_address | char(50) | YES | | NULL | |
| cust_city | char(50) | YES | | NULL | |
| cust_state | char(5) | YES | | NULL | |
| cust_zip | char(10) | YES | | NULL | |
| cust_country | char(50) | YES | | NULL | |
| cust_contact | char(50) | YES | | NULL | |
| cust_email | char(255) | YES | | NULL | |
+--------------+-----------+------+-----+---------+----------------+
Analysis
DESCRIBE requires that a table name be specified ( customers in this exam-
ple), and returns a row for each field containing the field name, its datatype,
whether NULL is allowed, key information, default value, and extra information
(such as auto_increment for field cust_id ).
 
Search WWH ::




Custom Search