create table tablename(
column1 type1,
column2 type2,
column3 type3
);
其中tablename 是表名,column1,2,3是列名,type1,2,3是类型,最常用的是number和VARCHAR2.
column1 type1,
column2 type2,
column3 type3
);
其中tablename 是表名,column1,2,3是列名,type1,2,3是类型,最常用的是number和VARCHAR2.
create table tablename(
column1 type1 primary key,
column2 type2 not null,
column3 type3
);
其中字段column1是主键,字段column2不能为空.
也可以写在文本里面
然后在sql*plus中调用
如:
@c:\ctable.sql
c1 number,
c2 varchar2(1) check (c2 in ('A','B','C')), -- 可选值约束
c3 varchar2(1) default 'T', -- 默认值
constraint pk_t primary key (c1) -- 定义主键
using index tablespace index_ts) -- 指定索引空间
tablespace ts;