zoukankan      html  css  js  c++  java
  • mysql 命令修改字段

    • 命令创建表
       1 create table drive_practice_statistics (
       2     id int(11) not null auto_increment,
       3     uid int(11) not null comment '用户id',
       4     correct_num smallint(4) not null default 0 comment '用户答对的题数',
       5     total smallint(4) not null default 0 comment '用户总的答题数,错误答题数=total-correct_num',
       6     mode tinyint(1) not null comment '驾照类型,1:a1,b1;2:a2,b2;3:c1,c2;4:科目四。c1和c2题目一样,a1和b1题目一样,a2和b2题目一样',
       7     addtime int(10) not null default 0,
       8     updatetime int(10) not null default 0,
       9     primary key (id),
      10     key (uid)
      11 )engine=innodb default charset=utf8;
      创建表SQL语句
    • 创建表之后,想要添加几个字段
      alter table drive_cheats add status tinyint(1) not null default 0 comment '是否上架,0:no,1:yes', add is_delete tinyint(1) not null default 0;
      //两个语句之间使用逗号隔开
    • 创建表之后,想要修改某个字段的类型`modify`, 字段的类型不可以省略,即便只是想改一下注释的内容,类型也要加上
      alter table drive_question modify mode tinyint(1) not null comment '驾照类型,1:a1,b1;2:a2,b2;3:c1,c2;4:科目四。c1和c2题目一样,a1和b1题目一样,a2和b2题目一样';
    • 修改某个字段的名称change
  • 相关阅读:
    Linux(centos)系统各个目录的作用详解
    java.util.ConcurrentModificationException异常处理
    欧几里得算法
    Google数据中心B4网络具体实现
    网络虚拟化
    SDN/NFV若干问题
    opendaylight的Beryllium安装
    解读SDN的东西、南北向接口
    SFC中的故障管理
    SFC中的问题描述
  • 原文地址:https://www.cnblogs.com/bneglect/p/12106031.html
Copyright © 2011-2022 走看看