Home > Database > Mysql Tutorial > body text

How to view the table structure in mysql?

青灯夜游
Release: 2019-06-15 17:20:26
Original
69387 people have browsed it

How to view the table structure in mysql? The following article will introduce to you the commonly used methods to view the mysql table structure. I hope it will be helpful to you.

Mysql method to view the table structure:

1. Use the desc command

Syntax:

desc 表名;
Copy after login

Example: Take the view of student (sid,sname,birthday,sex) as an example

How to view the table structure in mysql?

Use the following command to view the table structure:

desc student;
Copy after login

How to view the table structure in mysql?

2. Use the describe command

Syntax:

describe 表名;
Copy after login

3. Use the show command

The show command can be used in many ways to view the table structure:

Syntax 1:

show columns from 表名;
Copy after login

Syntax 2:

show create table 表名;
Copy after login

Example:

show create table student;
Copy after login

How to view the table structure in mysql?

Grammar 3:

show full fields from 表名;
Copy after login

Example:

show full fields from student;
Copy after login

How to view the table structure in mysql?

## Grammar 4:

show fields from 表名;
Copy after login

Example:

show fields from student;
Copy after login

How to view the table structure in mysql?

The above is the detailed content of How to view the table structure in mysql?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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 [email protected]
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!