房屋出租数据库设计

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

use Fwchuzus
create table users--用户表
(
uid int identity(1,1) primary key not null,
uname varchar(50) not null,
upwd varchar(50) not null,
uemail varchar(50)not null,
utype int not null,--用户类型 (1:管理员,0:前台用户)
ubitid int not null--是否有效 0:无效,1:有效
)
create table distory--房屋出租记录表
(
did int identity(1,1) primary key,
dhouseid int foreign key references house(hid) not null,--房屋
dtime varchar(25) not null,--出租时间
dmoney float not null,--租金
)
create table house--房屋信息表
(
hid int identity(1,1)primary key ,
htitile varchar(100) not null,--房屋出租标题
husersid int foreign key references users(uid) not null,--发布人
hxtype varchar(50) not null,--房屋的类型 大概分为 新房,二手房,别墅,其他
hchaoxiang varchar(50) not null,--房屋朝向
hzhuangxiu varchar(50) not null,--装修情况
hvlouceng int not null,--当前的楼层
hlouceng int not null,--共多少层
hmianji float not null,--房屋面积
hpeople varchar(20)not null,--联系人
htel varchar(15) not null,--房东联系电话
hutime varchar(25) not null,--房屋上架时间
hdtime varchar(25) not null,--房屋下架时间
hpeizhi varchar(500) not null,--房屋配置(家电等。。)
hmoney float not null,--房屋租金
hfukuangfangshi varchar(50) not null,--付款方式(半年,押一付二)
hjiequid int foreign key references jiequ(jid) not null,--所属街道
hfangxin varchar(100) not null,--几室几厅
haddress varchar(100) not null,--具体地址
hstate int not null,--是否出租 0:出租,1:没有出租
hbitid int not null,--是否有效 0:无效,1:有效 2:被举报的
hremark varchar(300) not null--备注
)

--房屋分为 类型,分区,街区,总价,房型
create table fenqu --分区表
(
fid int identity(1,1) primary key,
fname varchar(20) not null,--区名
fbitid int not null--是否有效 0:无效,1:有效
)
create table jiequ--街区表
(
jid int identity(1,1) primary key,
jfenquid int foreign key references fenqu(fid) not null,--所属分区
jname varchar(20) not null,--街区名称
jbitid int not null--是否有效 0:无效,1:有效
)
--留言
create table liuyuan--留言表
(
lid int identity(1,1) primary key,
lhouseid int foreign key references house(hid) not null,--房屋
ltime varchar(20)not null,--发送时间
lcontext varchar(200) not null,--留言内容
uid int foreign key references users(uid) not null,--发的人
lstate int not null--是否有效(0:无效,1:有效) 2:被举报的
)

create table duanxin --短信
(
did int identity(1,1)primary key,
duid int foreign key references users(uid) not null,--发短信的人
dsuid int foreign key references users(uid) not null,--收短信的人
dti

me varchar(20)not null,--发送时间
dinfo varchar(500)not null,--短信内容
dstate int not null--是否有效 0:无效,1:有效
)
--房屋能紧急出租 需付钱
create table yinghang--银行账号表
(
yid int identity(1,1) primary key,
ycard varchar(30) not null,--银行卡号
ypwd varchar(20) not null,--银行密码
ymoney float not null,--卡上余额
)
create table jinji--紧急出租管理表
(
jid int identity(1,1) primary key,
jhouseid int foreign key references house(hid) not null,--房屋(当房屋已经存在,并且还有效的时候 ,则在此基础上加时间)10元钱折算30天
jstartime varchar(30) not null,--生效时间
jendtime varchar(30) not null,--失效时间
jstate int not null,--是否有效 1:有效,0:无效 (当失效时间大于当前的时间时 即是失效)

)
--求房
create table qiufangxinxi--求房信息表
(
qid int identity(1,1)primary key ,
qtitile varchar(200) not null,--房屋求租标题
qusersid int foreign key references users(uid) not null,--发布人
qtel varchar(15) not null,--求租人联系电话
qtime varchar(25) not null,--信息上架时间
qbitid int not null,--是否有效 0:无效,1:有效
qcontent varchar(1000) not null --求房信息
)
create table jinjiqiufang--紧急求房管理表
(
jid int identity(1,1) primary key,
jhouseid int foreign key references qiufangxinxi(qid) not null,--房屋(当房屋已经存在,并且还有效的时候 ,则在此基础上加时间)10元钱折算30天
jstartime varchar(30) not null,--生效时间
jendtime varchar(30) not null,--失效时间
jstate int not null,--是否有效 1:有效,0:无效 (当失效时间大于当前的时间时 即是失效)
)
create table shoucang--收藏
(
sid int identity(1,1)primary key,
shouseid int foreign key references house(hid) not null,--收藏的信息
suid int foreign key references users(uid) not null,--收藏的人
sstate int not null--是否有效 1:有效,0:无效
)


相关文档
最新文档