比如建立一个新表Student
属性:学号(定长字符串,12)
     姓名(变长字符串,20,非空)
      出生日期(日期时间,非空)
      是否党员(逻辑型)
      班委(定长字符串,8)
主键:学号SQL语句:
create table Student
 (Sno char(12) ,
  Sname varchar(20) not null,
  Sdate date not null,
  Smem boolean,
  Scom char(8),
  primary key (Sno)
 );

解决方案 »

  1.   


    create   table   Student 
      (Sno   char(12)  primary   key    , 
        Sname   varchar(20)   not   null, 
        Sdate   date   not   null, 
        Smem   boolean, 
        Scom   char(8)
      );
      

  2.   


    oracle没有bollean类型!!
     create   table   Student 
      (Sno   char(12)  primary   key    , 
        Sname   varchar(20)   not   null, 
        Sdate   date   not   null, 
        Smem   CHAR(1), 
        Scom   char(8)
      );
      

  3.   

    CREATE TABLE student
    (
        Sno   char(12)   , 
        Sname   varchar(20)   not   null, 
        Sdate   date   not   null, 
        Smem   boolean, 
        Scom   char(8), 
        CONSTRAINT PK_student PRIMARY KEY (sno )
    )
      

  4.   

    创建表的时候oracle没有boolean型
    没记错的话pl/sql里有boolean型