当前位置:Gxlcms > 数据库问题 > SQL经典题-实战

SQL经典题-实战

时间:2021-07-01 10:21:17 帮助过:3人阅读

  1. -- Create table  
  2. create table DB_IMP_COURSE  
  3. (  
  4.   C#    NUMBER,  
  5.   CNAME VARCHAR2(10),  
  6.   T#    NUMBER  
  7. )  
  8. tablespace SYSTEM  
  9.   pctfree 10  
  10.   pctused 40  
  11.   initrans 1  
  12.   maxtrans 255  
  13.   storage  
  14.   (  
  15.     initial 64K  
  16.     minextents 1  
  17.     maxextents unlimited  
  18.   );  
  19. -- Add comments to the table   
  20. comment on table DB_IMP_COURSE  
  21.   is ‘课程表‘;  
  22. -- Add comments to the columns   
  23. comment on column DB_IMP_COURSE.C#  
  24.   is ‘课程编号‘;  
  25. comment on column DB_IMP_COURSE.CNAME  
  26.   is ‘课程名字‘;  
  27. comment on column DB_IMP_COURSE.T#  
  28.   is ‘教师编号‘;  

 

[sql] view plain copy
  1. -- Create table  
  2. create table DB_IMP_SC  
  3. (  
  4.   S#    NUMBER not null,  
  5.   C#    NUMBER,  
  6.   SCORE VARCHAR2(10)  
  7. )  
  8. tablespace SYSTEM  
  9.   pctfree 10  
  10.   pctused 40  
  11.   initrans 1  
  12.   maxtrans 255  
  13.   storage  
  14.   (  
  15.     initial 64K  
  16.     minextents 1  
  17.     maxextents unlimited  
  18.   );  
  19. -- Add comments to the table   
  20. comment on table DB_IMP_SC  
  21.   is ‘ 成绩表 ‘;  
  22. -- Add comments to the columns   
  23. comment on column DB_IMP_SC.S#  
  24.   is ‘学号‘;  
  25. comment on column DB_IMP_SC.C#  
  26.   is ‘课程编号‘;  
  27. comment on column DB_IMP_SC.SCORE  
  28.   is ‘成绩‘;  

 

[sql] view plain copy
  1. -- Create table  
  2. create table DB_IMP_STUDENT  
  3. (  
  4.   S#    NUMBER not null,  
  5.   SNAME VARCHAR2(12),  
  6.   SAGE  VARCHAR2(3),  
  7.   SSEX  VARCHAR2(2)  
  8. )  
  9. tablespace SYSTEM  
  10.   pctfree 10  
  11.   pctused 40  
  12.   initrans 1  
  13.   maxtrans 255  
  14.   storage  
  15.   (  
  16.     initial 64K  
  17.     minextents 1  
  18.     maxextents unlimited  
  19.   );  
  20. -- Add comments to the table   
  21. comment on table DB_IMP_STUDENT  
  22.   is ‘ 学生表‘;  
  23. -- Add comments to the columns   
  24. comment on column DB_IMP_STUDENT.S#  
  25.   is ‘学号‘;  
  26. comment on column DB_IMP_STUDENT.SNAME  
  27.   is ‘学生姓名‘;  
  28. comment on column DB_IMP_STUDENT.SAGE  
  29.   is ‘学生年龄‘;  
  30. comment on column DB_IMP_STUDENT.SSEX  
  31.   is ‘学生性别  
  32. ‘;  

 

[sql] view plain copy
    1. -- Create table  
    2. create table DB_IMP_TEACHER  
    3. (  
    4.   T#    NUMBER not null,  
    5.   TNAME VARCHAR2(12)  
    6. )  
    7. tablespace SYSTEM  
    8.   pctfree 10  
    9.   pctused 40  
    10.   initrans 1  
    11.   maxtrans 255  
    12.   storage  
    13.   (  
    14.     initial 64K  
    15.     minextents 1  
    16.     maxextents unlimited  
    17.   );  
    18. -- Add comments to the table   
    19. comment on table DB_IMP_TEACHER  
    20.   is ‘教师表 ‘;  
    21. -- Add comments to the columns   
    22. comment on column DB_IMP_TEACHER.T#  
    23.   is ‘教师编号‘;  
    24. comment on column DB_IMP_TEACHER.TNAME  
    25.   is ‘教师名字‘; 

SQL经典题-实战

标签:

人气教程排行