I have a questions is it possible to set a date in tables NULL(in my case that a shipdate does not exist)? E.g I have this following tables:
Customer{cid,name}
Product{prodno,name}
Order{orderid, shipdate, cid}
Ordered{orderid, prodno, quantity}
And now I wanto to get all Products which were never ordered. So I create this in RA(Relational Algebra):
πP.name,P.prodno(σO.cid = C.cid AND Order.shipdate is NULL(Order)))⋈Customer)
I am sure that it looks in SQL query:
SELECT P.Name, P.Prodno
FROM CUSTOMERS C, Order O E, Ordered Ordd Product P
WHERE O.CID = C.CID
AND O.shipdate is Null
so I think if date is could possible in SQL than I can get all products that are not ordered. maybe it could be possible to do it with the table Ordered but how maybe if I check if the Order.orderid is not equal to Ordered.orderid and Porduct.prodno is not equal to Ordered.prodno not sure how so create it in the RA. But is to complex for only getting the Products, so I think my RA and SQ could be right or?
2.Update
SELECT prodno, name
FROM Products P, Order O Ordered Ordd
WHERE prodno NOT IN (
SELECT prodno FROM Ordered
But how to create the RA?