Database Reference
In-Depth Information
+------------------------+--------------+------+-----+-------+----------------+
| bird_id | int(11) | NO | PRI | NULL |
auto_increment |
| scientific_name | varchar(100) | YES | UNI | NULL
| |
| common_name | varchar(255) | YES | | NULL
| |
| family_id | int(11) | YES | | NULL
| |
| conservation_status_id | int(11) | YES | | NULL
| |
| wing_id | char(2) | YES | | NULL
| |
| body_id | char(2) | YES | | NULL
| |
| bill_id | char(2) | YES | | NULL
| |
| description | text | YES | | NULL
| |
+------------------------+--------------+------+-----+-------+----------------+
The results are the same as for the DESCRIBE statement. However, with SHOW
COLUMNS , you can retrieve a list of columns based on a pattern. For instance, suppose
you just want a list of reference columns — columns that we labeled with the ending,
_id . You could enter this:
SHOW COLUMNS FROM birds LIKE '%id';
+------------------------+---------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default |
Extra |
+------------------------+---------+------+-----+---------+----------------+
| bird_id | int(11) | NO | PRI | NULL |
auto_increment |
| family_id | int(11) | YES | | NULL
| |
| conservation_status_id | int(11) | YES | | NULL
| |
| wing_id | char(2) | YES | | NULL
| |
| body_id | char(2) | YES | | NULL
| |
| bill_id | char(2) | YES | | NULL
| |
+------------------------+---------+------+-----+---------+----------------+
Search WWH ::




Custom Search