• 数据库-代码建表


    -- Create table
    create table COURSE
    (
    cno VARCHAR2(10) not null,          列名  数据类型  是否可为空
    cname VARCHAR2(20) not null,          列名  数据类型  是否可为空
    tno VARCHAR2(6) not null          列名  数据类型  是否可为空
    )
    tablespace USERS
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    (
    initial 64K
    next 1M
    minextents 1
    maxextents unlimited
    );
    -- Add comments to the columns           添加注释
    comment on column COURSE.cno          在cno列中添加注释
    is '课程号(主键)';                   注释为  ‘XXX’
    comment on column COURSE.cname
    is '课程名称';
    comment on column COURSE.tno
    is '教工编号(外键)';


    -- Create/Recreate primary, unique and foreign key constraints
    alter table COURSE
    add constraint C_COUNRSE primary key (CNO)          添加cno为主键
    using index
    tablespace USERS
    pctfree 10
    initrans 2
    maxtrans 255
    storage
    (
    initial 64K
    next 1M
    minextents 1
    maxextents unlimited
    );
    alter table COURSE
    add constraint C_TNO foreign key (TNO)          添加 tno 为外键
    references TEACHER (TNO);                外键关联 teacher  表中的 tno

  • 相关阅读:
    tree-cli 自动生成项目目录结构
    按需导入vant-ui
    全局导入vant-ui
    mook使用流程
    axios使用流程
    Vuex使用流程
    vue-router使用流程
    img的complete和onload
    react-redux 如何在子组件里访问store对象
    ES6中的Export/import操作的是引用
  • 原文地址:https://www.cnblogs.com/jingfengling/p/5947909.html
Copyright © 2020-2023  润新知