zoukankan      html  css  js  c++  java
  • MySQL语法

    MySQL一些语法


    - 增加表中列名的主键语法
    alter table student add constraint pk_表名_列名(id)primary key(id);

    - 添加表的列名
    alter table 表名 add 列名 列类型
    alter table student add homeaddress varchar(20);

    - 修改表的字段名
    alter table table_name change old_column_name new_column_name int(11);(oracle里吧change改成rename)

    - 添加外键
    alter table 从表 add constraint 外键(形如:FK_从表_主表) foreign key (从表外键字段) references 主表(主键字段);

    - 删除外键语法
    alter table 表名 drop foreign key 外键名

    - 修改表名:
    alter table student rename student1;

    做的不好,多多指教
  • 相关阅读:
    css3基础篇二
    css3基础篇一
    react基础篇六
    react基础篇五
    react基础篇四
    react基础篇三
    react基础篇二
    react基础篇一
    矩阵
    POJ 3071 Football
  • 原文地址:https://www.cnblogs.com/xingStudy/p/12836821.html
Copyright © 2011-2022 走看看