Get the App
SLTechnology News&Howtos  ›  Database  › 

Common methods of viewing table structure in mysql

Shulou Source: shulou.com Published: 2022-06-01 17:46:54 09月21日 Update

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.

Tags: Structure grammar commands methods examples commonly used content below can be passed a variety of practical nonsense ways more usefulness purpose articles industry information help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Information MariaDB Linux Huawei