Elektronika - baza wiedzy

Jak wyświetlić opis tabeli?


W celu wyświetlenia opisu danej tabeli używamy następującego polecenia:

DESCRIBE nazwa_tabeli;

Przykładowy wynik:

 
mysql> DESCRIBE users; 
+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| id          | int(11)      | NO   | PRI | NULL    | auto_increment |
| login       | varchar(255) | NO   |     | NULL    |                |
| password    | varchar(255) | NO   |     | NULL    |                |
| name        | varchar(255) | NO   |     | NULL    |                |
| surname     | varchar(255) | NO   |     | NULL    |                |
| e_mail      | varchar(255) | NO   |     | NULL    |                |
| address     | varchar(255) | NO   |     | NULL    |                |
| postal_code | varchar(255) | NO   |     | NULL    |                |
| city        | varchar(255) | NO   |     | NULL    |                |
| sex         | set('f','m') | NO   |     | NULL    |                |
| verify_key  | varchar(50)  | NO   |     | NULL    |                |
| joined      | datetime     | NO   |     | NULL    |                |
| active      | tinyint(1)   | NO   |     | NULL    |                |
+-------------+--------------+------+-----+---------+----------------+
13 rows in set (0.02 sec)