将 SQL 转换为关系代数
请任何人帮忙将以下两个 SQL 语句转换为关系代数
1)
SELECT D.Dname
FROM Employee E, Department D
WHERE E.Dno = D.Dno
AND E.Lname='Smith'
AND S.Fname='John'
2)
SELECT B.Town
FROM Staff S, Branch B
WHERE S.BranchId = B.BranchId
AND S.lName='Pincher'
AND S.fName='Penny'
Please can anyone help convert the following two SQL statements to Relational Algebra
1)
SELECT D.Dname
FROM Employee E, Department D
WHERE E.Dno = D.Dno
AND E.Lname='Smith'
AND S.Fname='John'
2)
SELECT B.Town
FROM Staff S, Branch B
WHERE S.BranchId = B.BranchId
AND S.lName='Pincher'
AND S.fName='Penny'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
...我想你的意思是 WHERE 子句中的 D.Fname = 'John'
... and I suppose you meant D.Fname = 'John' in WHERE clause
下面是第二条 SQL 语句的关系代数:
π Town (σ lName = 'Pincher' ^ fName = 'Penny' (Staff |x| BranchId分支))
Here's the relational algebra for the second SQL statement:
π Town (σ lName = 'Pincher' ^ fName = 'Penny' (Staff |x| BranchId Branch))
π Dname (σ Lname = 'Smith' ^ Fname = 'John' (员工 |x| Dno 部门))
π Dname (σ Lname = 'Smith' ^ Fname = 'John' (Employee |x| Dno Department))