Home > Database > Mysql Tutorial > body text

What information does the MySQL DESCRIBE statement display?

王林
Release: 2023-08-26 09:01:20
forward
926 people have browsed it

MySQL DESCRIBE 语句显示什么样的信息?

The DESCRIBE statement provides information about the structure of a MySQL table.

Example

Consider constructing the following table name "Employee" using Create Table statement as shown below-

mysql> Create table Employee(ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, Name Varchar(20));
Query OK, 0 rows affected (0.20 sec)
Copy after login

Now with the help of "DESCRIBE Employee" statement , we can get information about the employee table.

mysql> Describe Employee;
+-------+-------------+------+-----+---------+------------------+
| Field | Type        | Null | Key | Default | Extra            |
+-------+-------------+------+-----+---------+------------------+
| ID    | int(11)     | NO   | PRI | NULL    | auto_increment   |
| Name  | varchar(20) | YES  |     | NULL    |                  |
+-------+-------------+------+-----+---------+------------------+
2 rows in set (0.11 sec)
Copy after login

The above description tells us the name of the column, its data type, whether it can have NULL values, what values ​​it can store by default, its key constraints, and any other extras about it Information, such as auto_increment.

The above is the detailed content of What information does the MySQL DESCRIBE statement display?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!