To verify the table structure, use a DESCRIBE statement : Describe Table Structure : Table MySQL TUTORIALS


MySQL TUTORIALS » Table » Describe Table Structure »

 

To verify the table structure, use a DESCRIBE statement


mysql>
mysql>
mysql> CREATE TABLE myTable (
    -> id           int,
    -> first_name   VARCHAR(20),
    -> last_name    VARCHAR(20),
    -> sex          CHAR(1),
    -> start_date   DATE,
    -> end_date     DATE);
Query OK, rows affected (0.05 sec)

mysql>
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| mytable        |
+----------------+
row in set (0.00 sec)

mysql>
mysql> describe myTable;
+------------+-------------+------+-----+---------+-------+
| Field      | Type        | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| id         | int(11)     | YES  |     | NULL    |       |
| first_name | varchar(20| YES  |     | NULL    |       |
| last_name  | varchar(20| YES  |     | NULL    |       |
| sex        | char(1)     | YES  |     | NULL    |       |
| start_date | date        | YES  |     | NULL    |       |
| end_date   | date        | YES  |     | NULL    |       |
+------------+-------------+------+-----+---------+-------+
rows in set (0.00 sec)

mysql>
mysql> drop table myTable;
Query OK, rows affected (0.00 sec)

mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Table
» Describe Table Structure