the following exercise asks me to translate from relational algebra to SQL code.
I am still not very familiar with relational algebra, but I have tried to code the following relations in SQL, but I think I made some mistakes.
**> [Customer × Product ]―[π{Cid, Name, Pid, Label}(Customer ⋈ Orders ⋈ line_item)]**
SELECT * FROM Customer, Product WHERE Cid, Name, Pid, Label NOT IN
(SELECT Cid, Name, Pid, Label FROM Customer NATURAL JOIN Orders
NATURAL JOIN line_item);
For this one I really do not know how to deal with this algebra relation:
**> πName,Name2(σCid<Cid2 (πCid,Name,Pid (Customer ⋈ Orders ⋈ line_item)
⋈ βCid→Cid2,Name→Name2 (πCid,Name,Pid (Customer ⋈ Orders ⋈
line_item))))**
It would be highly appreciated if you could explain me the reasoning process in order to deal with this type of algebra relationships.