-- Create table 客户信息表(j_customer)
create table J_CUSTOMER
(
KID INTEGER not null,
KNAME VARCHAR2(20),
KPASSWORD VARCHAR2(20),
KQUESTION VARCHAR2(50),
KANSWER VARCHAR2(20),
KCARD VARCHAR2(18),
KEMAIL VARCHAR2(20),
KTEL VARCHAR2(20),
KXINGMING VARCHAR2(20)
)
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 J_CUSTOMER
add constraint PK_KID primary key (KID)
using index
tablespace USERS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
alter table J_CUSTOMER
add constraint U_KNAME unique (KNAME)
using index
tablespace USERS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
-- Create table 区域表(j_area)
create table J_AREA
(
QID INTEGER not null,
QNAME VARCHAR2(10)
)
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 J_AREA
add constraint PK_QID primary key (QID)
using index
tablespace USERS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
-- Create table 地名表(j_place)
create table J_PLACE
(
DID INTEGER not null,
DNAME VARCHAR2(10),
QID INTEGER
)
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 J_PLACE
add constraint PK_JPLACE_DID primary key (DID)
using index
tablespace USERS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
alter table J_PLACE
add constraint FK_JPLACE_QID_JA_QID foreign key (QID)
references J_AREA (QID);
-- Create table 房地产商信息表(j_company)
create table J_COMPANY
(
CID INTEGER not null,
CNAME VARCHAR2(20),
CPASSWORD VARCHAR2(20),
CMINGZI VARCHAR2(20),
CADDRESS VARCHAR2(50),
CTEL VARCHAR2(20),
CINSTRODUCTION VARCHAR2(200),
CEMAIL VARCHAR2(20),
CFAX VARCHAR2(20),
CPURVIEW NUMBER(1) default 0,
CQUESTION VARCHAR2(50),
CANSWER VARCHAR2(50)
)
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 J_COMPANY
add constraint PK_CID primary key (CID)
using index
tablespace USERS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
-- Create table 激活码表(j_activation)
create table J_ACTIVATION
(
AID INTEGER not null,
CID INTEGER,
ASTARTIME DATE,
AENDTIME DATE,
ANUMBER VARCHAR2(6)
)
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 J_ACTIVATION
add constraint PK_AID primary key (AID)
using index
tablespace USERS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
alter table J_ACTIVATION
add constraint FK_JACTIVE_CID_J_COM_CID foreign key (CID)
references J_COMPANY (CID);
-- Create table 楼盘表(j_build)
create table J_BUILD
(
LID INTEGER not null,
LNAME VARCHAR2(20),
LTYPE VARCHAR2(20),
LNUMFLOOR INTEGER,
LCONDITION VARCHAR2(200),
LTRAFFIC VARCHAR2(200),
LAREA FLOAT,
LPRICE FLOAT,
LIMG VARCHAR2(50),
LTIME DATE,
DID INTEGER,
CID INTEGER,
QID INTEGER
)
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 J_BUILD
add constraint PK_LID primary key (LID)
using index
tablespace USERS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
alter table J_BUILD
add constraint FK_CID_J_COMPANY_CID foreign key (CID)
references J_COMPANY (CID);
alter table J_BUILD
add constraint FK_DID_JPLACE_DID foreign key (DID)
references J_PLACE (DID);
alter table J_BUILD
add constraint FK_QID_JAREA_QID foreign key (QID)
references J_AREA (QID);
-- Create table 套房表(j_house)
create table J_HOUSE
(
HID INTEGER not null,
LID INTEGER,
HFLOOR INTEGER,
HDOOR VARCHAR2(20),
HAREA FLOAT,
HPRICE FLOAT,
HIMG VARCHAR2(50),
HTREND VARCHAR2(10),
HSTATE INTEGER,
HNUMBER INTEGER
)
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 J_HOUSE
add constraint PK_J_HOUSE_HID primary key (HID)
using index
tablespace USERS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
alter table J_HOUSE
add constraint FK_J_HOUSE_LID_JB_LID foreign key (LID)
references J_BUILD (LID);
-- Create table 评论表(j_review)
create table J_REVIEW
(
PID INTEGER not null,
PDESCRIBE VARCHAR2(200),
KID INTEGER,
LID INTEGER,
PTIME DATE
)
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 J_REVIEW
add constraint PK_PID primary key (PID)
using index
tablespace USERS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
alter table J_REVIEW
add constraint FK_KID_J_CUSTOMER_KID foreign key (KID)
references J_CUSTOMER (KID);
alter table J_REVIEW
add constraint FK_LID_J_BUILD_LID foreign key (LID)
references J_BUILD (LID);
-- Create table 购房意向表(j_will)
create table J_WILL
(
WID INTEGER not null,
DID INTEGER,
QID INTEGER,
WTYPE VARCHAR2(20),
WPRICE VARCHAR2(20),
WDOOR VARCHAR2(20),
KID INTEGER
)
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 J_WILL
add constraint PK_WID primary key (WID)
using index
tablespace USERS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
alter table J_WILL
add constraint FK_JWILL_DID_JPLACE_DID foreign key (DID)
references J_PLACE (DID);
alter table J_WILL
add constraint FK_JWILL_KID_JCUS_KID foreign key (KID)
references J_CUSTOMER (KID);
alter table J_WILL
add constraint FK_JWILL_QID_JAREA_QID foreign key (QID)
references J_AREA (QID);
-- Create table 系统管理员信息表(j_sysadmin)
create table J_SYSADMIN
(
AID INTEGER not null,
ANAME VARCHAR2(20),
APASS VARCHAR2(20)
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
评论0
最新资源