数据库关系代数-讨论题

 

1.提供客户通过代理下订单的所有(cname、aname)对  用乘积

((ORDERS × CUSTOMERS × AGENTS)where ORDERS.cid=CUSTOMERS.cid AND ORDERS.aid=AGENTS.aid) [ cname,aname]

2.提供客户通过代理下订单的所有(cname、aname)对 用自然链接

(ORDERS ⋈CUSTOMERS⋈AGENTS)[cname,aname]

3.get pids and pname of products that are stored in the city as  one of the agents who sold these products.( 取出商品的pname,and pid,要求这些商品所在的城市和某个销售过该商品的代理商所在的城市相同。)用乘积!

((ORDERS×PRODUCTS×AGENTS)where ORDERS.pid=PRODUCTS.pid and            ORDERS.aid=AGENTS.aid and PRODUCTS.city=AGENTS.city)[pname,pid]

4 get pids and panmes of priducts that are stored

in the city as one of the agents who sold these products

(取出商品的pname and pid,要求这些商品所在的城市和某个销售过该商品的代理商所在的城市相同。)用自然链接!

(PRODUCTSORDERSAGENTS )[pname,pid]

5.retrieve aids of agents with the largest percent.

检索具有最大百分比的代理的aids

A1:=AGENTS A2:=AGENTS

T1:=(A1× A2 where A1.percent<A2.percent )[ A1.aid,A1.percent]

T2=(Agents[aid,percent]-T1)[cid]

6.Get names of agents who places orders for all products that ordered by any

customer at all.

获取为所有被每一个顾客订购的产品下订单的代理商的姓名。

((ORDERS[aid,pid]÷ ORDERS[pid]) AGENTS)[aname]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

种豆得瓜er

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值