Common methods of viewing table structure in mysql
The following is mainly to bring you mysql commonly used view table structure method, hope these contents can bring you practical use, this is also my edit mysql commonly used view table structure method this article's main purpose. Okay, no more nonsense, let's go straight to the following.
mysql View table structure:
1. Use the desc command
Grammar:
desc table name;
Example: Take student (sid,sname,birthday,sex) as an example
Use the following command to view the table structure:
desc student;
2. Use the describe command
Grammar:
describe table name;
3. Use the show command
The show command can view the table structure in a number of ways:
Syntax 1:
show columns from table names;
Grammar 2:
show create table name;
Examples:
show create table student;
Syntax 3:
show full fields from table name;
Examples:
show full fields from student;
Grammar 4:
show fields from table names;
Examples:
show fields from student;
For the above method of looking at the table structure commonly used in mysql, do you think it is very helpful? If you need to know more, please continue to pay attention to our industry information, I believe you will like these contents.