- -- Create table
- create table DB_IMP_COURSE
- (
- C# NUMBER,
- CNAME VARCHAR2(10),
- T# NUMBER
- )
- tablespace SYSTEM
- pctfree 10
- pctused 40
- initrans 1
- maxtrans 255
- storage
- (
- initial 64K
- minextents 1
- maxextents unlimited
- );
- -- Add comments to the table
- comment on table DB_IMP_COURSE
- is ‘课程表‘;
- -- Add comments to the columns
- comment on column DB_IMP_COURSE.C#
- is ‘课程编号‘;
- comment on column DB_IMP_COURSE.CNAME
- is ‘课程名字‘;
- comment on column DB_IMP_COURSE.T#
- is ‘教师编号‘;
[sql] view plain copy
- -- Create table
- create table DB_IMP_SC
- (
- S# NUMBER not null,
- C# NUMBER,
- SCORE VARCHAR2(10)
- )
- tablespace SYSTEM
- pctfree 10
- pctused 40
- initrans 1
- maxtrans 255
- storage
- (
- initial 64K
- minextents 1
- maxextents unlimited
- );
- -- Add comments to the table
- comment on table DB_IMP_SC
- is ‘ 成绩表 ‘;
- -- Add comments to the columns
- comment on column DB_IMP_SC.S#
- is ‘学号‘;
- comment on column DB_IMP_SC.C#
- is ‘课程编号‘;
- comment on column DB_IMP_SC.SCORE
- is ‘成绩‘;
[sql] view plain copy
- -- Create table
- create table DB_IMP_STUDENT
- (
- S# NUMBER not null,
- SNAME VARCHAR2(12),
- SAGE VARCHAR2(3),
- SSEX VARCHAR2(2)
- )
- tablespace SYSTEM
- pctfree 10
- pctused 40
- initrans 1
- maxtrans 255
- storage
- (
- initial 64K
- minextents 1
- maxextents unlimited
- );
- -- Add comments to the table
- comment on table DB_IMP_STUDENT
- is ‘ 学生表‘;
- -- Add comments to the columns
- comment on column DB_IMP_STUDENT.S#
- is ‘学号‘;
- comment on column DB_IMP_STUDENT.SNAME
- is ‘学生姓名‘;
- comment on column DB_IMP_STUDENT.SAGE
- is ‘学生年龄‘;
- comment on column DB_IMP_STUDENT.SSEX
- is ‘学生性别
- ‘;
[sql] view plain copy
- -- Create table
- create table DB_IMP_TEACHER
- (
- T# NUMBER not null,
- TNAME VARCHAR2(12)
- )
- tablespace SYSTEM
- pctfree 10
- pctused 40
- initrans 1
- maxtrans 255
- storage
- (
- initial 64K
- minextents 1
- maxextents unlimited
- );
- -- Add comments to the table
- comment on table DB_IMP_TEACHER
- is ‘教师表 ‘;
- -- Add comments to the columns
- comment on column DB_IMP_TEACHER.T#
- is ‘教师编号‘;
- comment on column DB_IMP_TEACHER.TNAME
- is ‘教师名字‘;
SQL经典题-实战
标签: