您的位置:首页 > 博客中心 > 数据库 >

MySQL数据库操作3-数据表操作2-查看数据表结构

时间:2022-03-14 01:51

describe语句:

语法:

describe 表名;

简化写法:

desc 表名

注意

1.两种写法结果相同,

2.可以不使用分号结尾,

3.不支持多个表同时查询。

 

查询表创建的详细结构:

代码:

show create table test_t;

结果:

‘test_t‘, ‘CREATE TABLE `test_t` (\n  `name` char(12) DEFAULT NULL,\n  `sex` char(12) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8‘

这是创建的时候的数据。也可以加上参数\G用行输出。

show create table test_t\G;

热门排行

今日推荐

热门手游