高手请指点:查询Info表中余额排名第4-6名的用户信息
--创建表infocreate table info
(
i_Id int primary key identity(1,1) not null,
i_Name varchar(10) not null,
i_Address varchar(30) not null,
i_Balance money check(i_Balance>0)
)
--创建表card
create table card
(
c_Id int primary key identity(1,1) not null,
i_Id int foreign key(i_Id) references info(i_Id) not null,
c_Upda varchar(10) not null,
c_money money not null
)
--往info表里插入数据
insert into info values('张学良','深圳',2600)
insert into info values('刘德华','广州',6500)
insert into info values('赵本山','深圳',3600)
insert into info values('李鸿章','深圳',1200)
insert into info values('张三','上海',25400)
insert into info values('李四','广州',3600)
insert into info values('王五','上海',85600)
insert into info values('赵六','广州',3600)
insert into info values('洪金宝','深圳',4800)
insert into info values('上官云清','上海',500)
insert into info values('李世民','上海',6000)
--往card表里插入数据
insert into card values(1,'In',500)
insert into card values(5,'In',4500)
insert into card values(8,'Out',3200)
insert into card values(2,'In',6300)
insert into card values(6,'Out',200)
insert into card values(4,'Out',400)
insert into card values(10,'Out',800)
go