• 数据库


    -- Create table
    create table T_STUDENT
    (
      sno       VARCHAR2(3) not null,
      sname     VARCHAR2(8) not null,
      ssex      VARCHAR2(2) not null,
      sbirthday DATE,
      class     VARCHAR2(5)
    )
    tablespace USERS
      pctfree 10
      initrans 1
      maxtrans 255;
    -- Add comments to the table 
    comment on table T_STUDENT
      is '学生表';
    -- Add comments to the columns 
    comment on column T_STUDENT.sno
      is '学号(主键)';
    comment on column T_STUDENT.sname
      is '学生姓名';
    comment on column T_STUDENT.ssex
      is '学生性别';
    comment on column T_STUDENT.sbirthday
      is '学生出生年月';
    comment on column T_STUDENT.class
      is '学生所在班级';
    -- Create table
    create table COURSE
    (
      cno   VARCHAR2(5) not null,
      cname VARCHAR2(10) not null,
      tno   VARCHAR2(3) not null
    )
    tablespace USERS
      pctfree 10
      initrans 1
      maxtrans 255;
    -- Add comments to the table 
    comment on table COURSE
      is '课程表';
    -- Add comments to the columns 
    comment on column COURSE.cno
      is '课程号(主键)';
    comment on column COURSE.cname
      is '课程名称';
    comment on column COURSE.tno
      is '教工编号(外键)';
    -- Create table
    create table T_SCORE
    (
      sno    VARCHAR2(3) not null,
      cno    VARCHAR2(5) not null,
      degree NUMBER(4,1)
    )
    tablespace USERS
      pctfree 10
      initrans 1
      maxtrans 255;
    -- Add comments to the table 
    comment on table T_SCORE
      is '成绩表';
    -- Add comments to the columns 
    comment on column T_SCORE.sno
      is '学号(外键)';
    comment on column T_SCORE.cno
      is '课程号(外键)';
    comment on column T_SCORE.degree
      is '成绩';
    -- Create table
    create table TEACHER
    (
      tno       VARCHAR2(3) not null,
      tname     VARCHAR2(4) not null,
      tsex      VARCHAR2(2) not null,
      tbirthday DATE,
      prof      VARCHAR2(6),
      depart    VARCHAR2(10) not null
    )
    tablespace USERS
      pctfree 10
      initrans 1
      maxtrans 255;
    -- Add comments to the table 
    comment on table TEACHER
      is '教师表';
    -- Add comments to the columns 
    comment on column TEACHER.tno
      is '教工编号(主键)';
    comment on column TEACHER.tname
      is '教工姓名';
    comment on column TEACHER.tsex
      is '教工性别';
    comment on column TEACHER.tbirthday
      is '教工出生年月';
    comment on column TEACHER.prof
      is '职称';
    comment on column TEACHER.depart
      is '教工所在部门';

     

  • 相关阅读:
    inner join ,left join ,right join 以及java时间转换
    华为机试-整形数组合并
    华为机试-公共字串计算
    两个字符串的最长公共子序列的长度
    华为机试-字符串通配符
    工作中总结的编程小技巧
    C语言高效编程的几招(绝对实用,绝对经典)
    Java float保留两位小数或多位小数
    新浪云、阿里云、百度云、谷歌云、亚马逊云
    java经典40+分析
  • 原文地址:https://www.cnblogs.com/jskbk/p/5567277.html
Copyright © 2020-2023  润新知