数据库建表语句

STUDENTINFO
-- Create table
create table STUDENTINFO
(
id NUMBER not null,
student_name VARCHAR2(20) not null,
student_sex NUMBER not null,
student_age NUMBER not null,
student_address VARCHAR2(50) not null,
student_entime DATE not null,
class_id NUMBER not null
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
-- Create/Recreate primary, unique and foreign key constraints
alter table STUDENTINFO
add constraint ST_PK primary key (ID)
using index
tablespace USERS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
--------------------------------------------------------------------------
CLASSINFO
-- Create table
create table CLASSINFO
(
id number not null,
class_name varchar2(20) not null,
class_teacher varchar2(20) not null
)
partition by ()
(
partition

);
-- Create/Recreate primary, unique and foreign key constraints
alter table CLASSINFO
add constraint CL_PK primary key ()
disable;

相关文档
最新文档