这个程序是空房查询,但查询空房时不显示,不知道为什么,帮帮我哦,谢谢了
[此贴子已经被作者于2007-1-14 11:52:37编辑过]
这个程序是空房查询,但查询空房时不显示,不知道为什么,帮帮我哦,谢谢了
[此贴子已经被作者于2007-1-14 11:52:37编辑过]
create table kh(
kid char(4) not null primary key,
kname char(20) ,
ksex char(2) default '男' check (ksex='男' or ksex='女'),
kage smallint,
ktime smalldatetime);
create table room(
rid char(4) not null primary key,
rtype smallint,
rrn smallint);
create table kr(
kid char(4) not null foreign key references kh(kid),
rid char(4) not null foreign key references room(rid),
rd smallint,
rmoney int,
primary key(kid,rid),
);
insert into kh values('0001','周楠','男',20,'2007-05-08 12:35');
insert into kh values('0002','钱勇勇','男',20,'2007-05-08 12:35');
insert into kh values('0003','陆向荣','男',20,'2007-05-08 12:35');
insert into kh values('0004','周明','男',20,'2007-05-08 12:35');
insert into kh values('0005','冯树彪','男',20,'2007-05-08 12:35');
insert into kh values('0006','胥睿','男',20,'2007-05-08 12:35');
insert into room values('0001'1,2);
insert into room values('0002'2,2);
insert into room values('0003'3,2);
insert into room values('0004'4,2);
insert into room values('0005'5,2);
insert into room values('0006'6,2);
insert into kr values('0001','0001',1,null);
insert into kr values('0002','0002',2,null);
insert into kr values('0003','0003',1,null);
insert into kr values('0004','0004',1,null);
insert into kr values('0005','0006',1,null);
insert into kr values('0006','0005',1,null);