zoukankan      html  css  js  c++  java
  • 基本sql语句--列的增删改

    列的增删改
     
    列声明包括:列名称,列属性,【列类型】,【默认值】。
     
    增加列:add
    alter table 表名 add 列声明。
     
         如:alter table boy add height tinyint unsigned not null default 0;
    增加的列,默认在表的最后一列。
    可以用after声明新增列在那一列后面:alter table 表名 add 列声明 after 已存在列名。
         如:alter table boy add age tinyint unsigned not null default 0 after name;
     
    若新增列想放在第一列,需要用first关键字:alter table 表名 add 列声明 first。
         如:alter table boy add id int primary key auto_increment first;
     
    修改列:change
    alter table 表名 change 被改变的列 列声明。
         如:alter table boy change height height smallint not null default 180;
     
    删除列:drop
    alter table 表名 drop 列名。
         如:alter table boy drop id;
     
  • 相关阅读:
    python学习手册 (第3版)
    服务器搭建
    阿里云 大数据 云计算 分布式
    PS插件开发plugin
    GIS九交模型
    人脸识别 人工智能(AI)
    Github上发布托管和下载
    RPLiDAR 激光雷达探测地面高程
    linux内核调试
    convex hull
  • 原文地址:https://www.cnblogs.com/skyline1011/p/5939548.html
Copyright © 2011-2022 走看看