zoukankan      html  css  js  c++  java
  • 查看表结构的两种方式

    desc模式和show create table  具体模式

    mysql> select * from tb_emp8;
    +----+------+--------+--------+
    | id | name | deptid | salary |
    +----+------+--------+--------+
    |  1 | ds   |      2 |   NULL |
    |  2 | fr   |      7 |   NULL |
    |  3 | ds   |     99 |   NULL |
    +----+------+--------+--------+
    3 rows in set (0.00 sec)
    
    mysql> desc tb_emp8;
    +--------+-------------+------+-----+---------+----------------+
    | Field  | Type        | Null | Key | Default | Extra          |
    +--------+-------------+------+-----+---------+----------------+
    | id     | int(11)     | NO   | PRI | NULL    | auto_increment |
    | name   | varchar(25) | NO   |     | NULL    |                |
    | deptid | int(11)     | YES  |     | NULL    |                |
    | salary | float       | YES  |     | NULL    |                |
    +--------+-------------+------+-----+---------+----------------+
    4 rows in set (0.00 sec)
    
    mysql> show create table tb_emp8;
    +---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Table   | Create Table                                                                                                                                                                                                                                 |
    +---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | tb_emp8 | CREATE TABLE `tb_emp8` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `name` varchar(25) NOT NULL,
      `deptid` int(11) DEFAULT NULL,
      `salary` float DEFAULT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 |
    +---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    1 row in set (0.00 sec)
    RUSH B
  • 相关阅读:
    LG5283 异或粽子
    LG2216 理想的正方形
    LG1484 种树
    洛谷3721 HNOI2017单旋(LCT+set+思维)
    洛谷3348 大森林 (LCT + 虚点 + 树上差分)
    CF1082E Increasing Frequency (multiset+乱搞+贪心)
    CF1082G Petya and Graph(最小割,最大权闭合子图)
    cf1082D Maximum Diameter Graph(构造+模拟+细节)
    洛谷3320 SDOI2015寻宝游戏(set+dfs序)(反向迭代器的注意事项!)
    CF613D Kingdom and its Cities(虚树+贪心)
  • 原文地址:https://www.cnblogs.com/tangsonghuai/p/11002073.html
Copyright © 2011-2022 走看看