请问下面的数据库 关系代数表达式怎么写啊?
请问下面的数据库 关系代数表达式怎么写啊?
Employee(EmployeeId,EmployeeName,Block,UnitNo,Street,City)
Working(EmployeeId,CompanyId,Salary)
Company(CompanyId,CompanyName,City)
Managing(EmployeeId,ManagerID)
Write relational algebra expressions for the following queries:
(1) Find the list of EmployeeIds and EmployeeNames working in the company XYZ.
(2) Find all Employees who live in the same city as the company in which they work.
(3) Find all employees who work for City Bank and earn more than $30000.
(4) Find the number of employees working in each company and the average salary.
1)查询在XYZ工资工作的员工ID和姓名列表.SELECT a.EmployeeId,a.EmployeeName from Employee a,Working b,Company cwhere a.EmployeeId = b.EmployeeIdand b.CompanyId = c.CompanyIdand c.CompanyName = 'XYZ'2)查...请问,这个好像是SQL吧?不是relational algebra expressions。而且为什么这个SQL的写法会有a?b?c?之前那个SQL问题有一个的回答也是有a,b,c的。麻烦你再解析解析啊~谢谢!a, b, c是表的别名。就是表本身叫一个什么名字,而现在我取了一个别名,用起来方便。至于关系代数表达式,从大学毕业后就没写过了。第一个应该是π EMPLOYEEID, EMPLOYEENAME(EMPLOYEE连接符号WORKING)连接符号σcompanyname='XYZ'(COMPANY))以上的写法,连接符号就是cross那样的,两竖线中间是个叉,我找不到这个符号。厉害啊!还记得这么清楚啊!谢谢您的回答!SELECT语法咱们都已经写出来了,也就不怕分析关系代数表达式了。只要清楚这个写法,应该就可以写出来。您看看吧,我也叫不准了。好的~谢谢~有SQL的语法就能写出分析关系代数表达式了~我再等等看,还有没有回答~没有人回答的话,您这个就是最好的答案啦~谢谢您的帮助啊!您帮我解决了很多问题啊!万分的感激!