利用关系代数表示数据库请求行为

本文探讨了数据库查询中关系代数的重要性和应用场景,通过一系列例题详细解析如何使用关系代数解决各种查询问题,包括查找特定贷款、客户信息、账户余额、删除与插入记录以及利息支付等操作。
摘要由CSDN通过智能技术生成

数据库课当中,有一个重要的节点是讲述关系代数(Relational Algebra)的查询(query),感觉挺重要也挺有意思的,现来道例题仔细分析:

Schema: branch (branch_name, branch_city, assets) customer
(customer_name, customer_street, customer_city) account
(account_number, branch_name, balance) loan (loan_number, branch_name,
amount) depositor (customer_name, account_number) borrower
(customer_name, loan_number)

Q1: Find all loans of over $120

Q2: Find the loan number for each loan of an amount greater than $1200

Q3: Find the names of all customers who have a loan, an account, or both, from the bank

Q4: Find the names of all customers who have a loan at the Perryridge branch but do not have an account at any branch of the bank.

Q5: Find the names of all customers who have a loan at the Perryridge branch (multi-solution).

Q6: Find the largest account balance

Q7: Find the names of all customers who have a loan an

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值