- “数据库原理”上机题目汇总(1)
- 发布日期时间:2007-3-6 来源:不详 点击数: 作者:佚名
经过调查发现,“地铁”工程所有未偿还的贷款记录的贷款时间应该在2006-11-11日,做出以上更新。
declare c1 cursor for
select Bdate from project9527,Loan9527 where project9527.PID=Loan9527.PID and
Rdate is null
open c1
declare @x datetime
fetch next from c1 into @x
while @@fetch_status=0
begin
update Loan9527 set Bdate='2006-11-11'
where Bdate=@x
fetch next from c1 into @x
end
close c1
deallocate c1
6.列出同时满足如下条件的银行的银行号和银行名(20分):
a)该银行在济南。
b)贷出款的总金额大于与其在同一地区的其他任何银行的贷出款的总金额。
select Bank9527.BID,Bname from Bank9527,Loan9527 where Bank9527.city='济南' and Bank9527.BID=Loan9527.BID
group by Bank9527.BID,Bname
having sum(money1)>= all(select sum(money1) from Loan9527
group by Loan9527.BID )
文章转载请注明来源于:汕头自考网
网友评论
|
|



