我如何用关系代数、域关系演算和元组关系演算找到最高/最大的东西
这是家庭作业的一部分。我有几个问题要求找到薪水最高或第二高的员工的 eid。查找获得最多飞机认证的飞行员。我不知道该怎么做。本章中没有任何示例,谷歌也被证明没有那么有帮助。如果有人能告诉我如何做其中一项,那将会有很大帮助。
以下是表格:
飞机(援助:整数,名称:字符串,巡航范围:整数)
认证(< em>eid:整数,aid:整数)
员工(eid:整数,ename:字符串,工资:int)
This is part of a homework assignment. I've got several questions asking find the eid of the employee with the highest salary, or 2nd highest salary. Find the pilot that is certified for the most aircrafts. I don't have any idea on how to do it. There aren't any examples in the chapter, and google is proving less that helpful. If someone could show me how to do just one of these, it'll help a lot.
here are the tables:
Aircraft( aid: integer, aname: string, cruisingrange: integer )
Certified( eid: integer, aid: integer )
Employees( eid: integer, ename: string, salary: int )
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可以给您一个如何获取最大值和最小值的提示:
考虑一下您可以连接一个实体本身,现在考虑一下您可以使用什么连接标准..然后您可以使用连接的结果来减去来自您最初的一组元素的结果
编辑:如果您以第一薪水<=第二薪水的标准加入雇主,会发生什么?
I can give you an hint in how to obtain max and min values:
think about the fact that you can join an entity over itself, now think what join criteria you could use.. and then you can use the result of the join to subtract results from your initial set of elements
EDIT: what happens if you join employers with them selves with a criteria of having first salary <= second salary?