导航
  • 主页
  • 基础类
  • 应用实例
  • 新技术前沿

这个怎么写?我晕了……

qlxyeah 2003-12-17 03:37:40
(From this Book-----Database System Concepts (Edition Third)
who can tell me where to find the keys to exercises of this books, thanks!)

the relational database:

employee(employee-name,street,city)
works(employee-name,company-name,salary)
company(company-name,city)
manages(employee-name,manager-name)

give an expression in the relational algebra, the tuple relational calculus, and the domain relational calculus:

1)Find the names of all employees who live in the same city and on the same street as do their managers.

2)Find the names of all employees in this database who do not work for First Bank Corporation.

3)Find the names of all employees who earn more than every employee of Small Bank Corporation.

4)Assume the companies may be located in several cities. Find all companies located in every city in which Small Bank Corporation is located.
...全文
10 点赞 收藏 13
写回复
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
yyecho2008 2003-12-23
你可以查在某个city的所有employee呀,
回复
jackiehua 2003-12-19
gmlxf(烛光) 说的不错,字段不全。。。。
回复
qlxyeah 2003-12-18
大家帮我解决一下阿,满意的话立刻结贴!
回复
yun198183 2003-12-17
头都大了
回复
erigido 2003-12-17
看得好累啊
回复
hglhyy 2003-12-17
up!
回复
youngby 2003-12-17
sorry:

2.select employee-name,company-name from work where company-name not in ( select top 1 from company order by company-name )
回复
youngby 2003-12-17
2.select employee-name,company-name from work where company-name <> 'company-name'

回复
youngby 2003-12-17
1.select a.employee-name,a.adress,b.manager-name from (select employee-name,Adress=street+city from employee) a join manages b on a.employee-name=b.employee-name group by a.adress

回复
1ssp 2003-12-17
看不懂!顶
回复
gmlxf 2003-12-17
manager的city怎么没有?
company(company-name,city)?好象与其他表没有关联。
回复
gmlxf 2003-12-17
感觉缺少字段。
回复
看来得补英文了.
回复
发动态
发帖子
MS-SQL Server
创建于2007-09-28

3.2w+

社区成员

MS-SQL Server相关内容讨论专区
申请成为版主
社区公告
暂无公告