数据库创建代码: 1:用户表:(users) userid(主键),username(用户名),password(密码),sex(性别),head(头像),regdate(注册日期) 2:类别表:(types) tid(主键),type 3:技术表:(technic) teid(主键),tename(技术名),tsum(拥有帖子数量),tid(引用类别表主键) 4:帖子表:(card) cid(主键),title(标题),content(内容),outtime(发帖时间),uptime(修改帖子的时间),csum(回帖数量),tename(属于哪个技术), userid(引用用户表外键) 5:回帖表:(restore) rid(主键),rtitle(标题),rcontent(内容),routtime(发帖时间),ruptime(修改帖子的时间),tename(属于哪个技术), userid(引用用户表外键),cid(引用帖子表主键) --用户表:(users) -- Create table create table USERS ( USERID INTEGER not null, USERNAME VARCHAR2(20) not null, PASSWORD VARCHAR2(20) not null, SEX VARCHAR2(20) not null, HEAD VARCHAR2(20) not null, REGDATE DATE not null ) tablespace SYSTEM pctfree 10 pctused 40 initrans 1 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); -- Create/Recreate primary, unique and foreign key constraints alter table USERS add constraint PK_USERID primary key (USERID) using index tablespace SYSTEM pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); --类别表:(types) -- Create table create table TYPES ( TID INTEGER not null, TYPE VARCHAR2(20) not null ) tablespace SYSTEM pctfree 10 pctused 40 initrans 1 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); -- Create/Recreate primary, unique and foreign key constraints alter table TYPES add constraint PK_TID primary key (TID) using index tablespace SYSTEM pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); --技术表:(technic) -- Create table create table TECHNIC ( TEID INTEGER not null, TENAME VARCHAR2(20) not null, TSUM INTEGER not null, TID INTEGER not null ) tablespace SYSTEM pctfree 10 pctused 40 initrans 1 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); -- Create/Recreate primary, unique and foreign key constraints alter table TECHNIC add constraint PK_TEID primary key (TEID) using index tablespace SYSTEM pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); alter table TECHNIC add constraint FK_TID foreign key (TID) references TYPES (TID); --帖子表:(card) -- Create table create table CARD ( CID INTEGER not null, TITLE VARCHAR2(20) not null, CONTENT VARCHAR2(100) not null, OUTTIME DATE not null, UPTIME DATE not null, CSUM INTEGER not null, TENAME VARCHAR2(20) not null, USERID INTEGER ) tablespace SYSTEM pctfree 10 pctused 40 initrans 1 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); -- Create/Recreate primary, unique and foreign key constraints alter table CARD add constraint PK_CID primary key (CID) using index tablespace SYSTEM pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); alter table CARD add constraint FK_USERID foreign key (USERID) references USERS (USERID); --回帖表:(restore) -- Create table create table RESTORE ( RID INTEGER not null, RTITLE VARCHAR2(20) not null, RCONTENT VARCHAR2(100) not null, ROUTTIME DATE not null, RUPTIME DATE not null, TENAME VARCHAR2(20) not null, USERID INTEGER not null, CID INTEGER not null ) tablespace SYSTEM pctfree 10 pctused 40 initrans 1 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); -- Create/Recreate primary, unique and foreign key constraints alter table RESTORE add constraint PK_RID primary key (RID) using index tablespace SYSTEM pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited ); alter table RESTORE add constraint FK_CID foreign key (CID) references CARD (CID); alter table RESTORE add constraint FK_UID foreign key (USERID) references USERS (USERID); --序列号 -- Create sequence create sequence SEQ_CID minvalue 1 maxvalue 9999999999 start with 1 increment by 1 cache 20 order; --seq_userid -- Create sequence create sequence SEQ_USERID minvalue 1 maxvalue 9999991 start with 1 increment by 1 cache 20 order; --seq_tid -- Create sequence create sequence SEQ_TID minvalue 1 maxvalue 99999 start with 1 increment by 1 cache 20 order; --seq_teid -- Create sequence create sequence SEQ_TEID minvalue 1 maxvalue 999999 start with 1 increment by 1 cache 20 order; --seq_rid -- Create sequence create sequence SEQ_RID minvalue 1 maxvalue 99999 start with 1 increment by 1 cache 20 order;
2022-02-24 09:47:45 1.22MB bbs论坛
1
oracle视频教学视频
2022-02-24 09:08:24 237B 音视频 oracle 数据库 database
1
Oracle初级语句,大家可以给我点关注之后,自行领取。
2022-02-24 09:08:23 44KB oracle 数据库 database
1
[ORACLE]数据库维护收集.pdf
2022-02-23 14:07:37 995KB 网络资源
Oracle数据库异地容灾方案.doc
2022-02-22 14:03:21 545KB 智慧方案
对ORACLE-SQL进行一些布局优化,更新它的格式
2022-02-22 11:42:34 1KB SQL美化器 oracle
1
ORACLE-11G--RAC安装文档
2022-02-21 22:02:12 3.24MB oracle 数据库 database
在-Linux-x86-上安装-Oracle-数据库
2022-02-21 19:01:08 428KB oracle linux 数据库 database
toad for oracle 工具
2022-02-21 14:18:55 533.65MB oracle 数据库 database toad