zoukankan      html  css  js  c++  java
  • 添加表或者column 评论(comments)
    最大可以写到4000bytes
    语法: comment on table 表名 名字 ‘ 内容  ’

    修改表名
    rename 表名 to 新表名
    或者
    alter table 表名 rename to 新表名;

    给表添加专栏(column)
    alter table 表名 add column 专栏名 数据类型
    删除专栏
    alter table 表名 drop column  专栏名 ;

    改变专栏
    alter table 表名 modify专栏名 数据类型;
    参看约束
    SELECT constraint_name,constraint_type ,r_constraint_name
    FROM user_constraints
    WHERE table_name = 'EMPLOYEES';
    CONS
    CONSTRAINT_NAME TYPE R_CONSTRAINT_NAME
    ------------------------------ ------ ---------------------
    NN_EMP_ID C
    SYS_C005286 C
    EMPLOYEES_PK P
    UNIQ_PAYROLL_ID U
    EMP_DEPT_FK R DEPARTMENT_PK
    MGR_EMP_FK R EMPLOYEES_PK
    HIRE_DATE_CHECK C


    C 就是check
    P = PRIMARY KEY
    R = Referential 或者 foreign key
    U = unique

    或者
    SELECT search_condition
    FROM user_constraints
    WHERE constraint_name = 'SYS_C005286';
  • 相关阅读:
    HDU 2717 Catch That Cow
    补题列表
    Codeforces 862C 异或!
    HDU 2084
    HDU 2037
    Codeforces 492B
    POJ 2262
    Codeforces 1037A
    HDU 1276
    itertools — Functions creating iterators for efficient looping
  • 原文地址:https://www.cnblogs.com/lovewife/p/1427793.html
Copyright © 2011-2022 走看看