zoukankan      html  css  js  c++  java
  • Oracle 修改表 Alter Table...

    --增加列
    ALTER TABLE Student add sex number(2);
    --删除列
    ALTER TABLE Student drop column sex;
    --更改列属性
    ALTER TABLE Student modify city number(2);
    --更改默认值
    ALTER TABLE Student modify sex default 1;
    --增加表主键
    ALTER TABLE Student add constraint stu_pk primary key(student_id);
    --增加表外键
    ALTER TABLE Student add constraint stu_ref
    foreign key(school) references school(schoolid);
    --更改非空约束
    ALTER TABLE Student modify sname not null;
    --增加检查约束
    ALTER TABLE Student add constraint check_stu_age check (age>10);
    --增加唯一性
    ALTER TABLE Student add constraint uqe_phone unique (phone);
    --删除约束
    ALTER TABLE Student drop constraint uqe_phone;
    --约束失效
    ALTER TABLE Student disable constraint uqe_phone;
    --约束复效
    ALTER TABLE Student enable constraint uqe_phone;
    --修改表名
    ALTER TABLE Student RENAME TO Student2
    --修改表列名
    ALTER TABLE Student RENAME COLUMN phone TO phoneno
    --表备注 Add comments to the table
    comment on table STUDENT
    is '学生';
    --字段备注 Add comments to the columns
    comment on column STUDENT.sname
    is '姓名';

  • 相关阅读:
    .NET 第一天
    C# 多线程操作同一文件
    c# 进制转换-续
    C# 进制转化
    DevExpress.Utils.ToolTipLocation
    gridView 练习
    dashboard 数据绑定的时候 addTable 是视图
    gridLookUpEdit1
    gridview1 设置 内容居中 标题剧中
    LOOKupE
  • 原文地址:https://www.cnblogs.com/walkwithmonth/p/6306793.html
Copyright © 2011-2022 走看看