can someone please help me to solve the relational algebra equation?
-
CUSTOMER (Cust#, Cname, City) ORDER (Order#, Odate, Cust#, Ord_Amt) ORDER_ITEM (Order#, Item#, Qty) ITEM (Item#, Unit_price) SHIPMENT (Order#, Warehouse#, Ship_Date) WAREHOUSE (Warehouse#, City) List the orders that were not shipped within 14 days of ordering. Produce a list of Cname who has not placed any orders.
-
CUSTOMER (Cust#, Cname, City) ORDER (Order#, Odate, Cust#, Ord_Amt) ORDER_ITEM (Order#, Item#, Qty) ITEM (Item#, Unit_price) SHIPMENT (Order#, Warehouse#, Ship_Date) WAREHOUSE (Warehouse#, City) List the orders that were not shipped within 14 days of ordering. Produce a list of Cname who has not placed any orders.
It's not a "relational algebra equation" - the assignment is to write a thing called a "query". A "select query" to be more exact. I can help with the assignment if you have a specific question, but I'm not going to give the solution. If you're looking how to get started, then I suggest you write a script to generate said tables with some testdata.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
-
CUSTOMER (Cust#, Cname, City) ORDER (Order#, Odate, Cust#, Ord_Amt) ORDER_ITEM (Order#, Item#, Qty) ITEM (Item#, Unit_price) SHIPMENT (Order#, Warehouse#, Ship_Date) WAREHOUSE (Warehouse#, City) List the orders that were not shipped within 14 days of ordering. Produce a list of Cname who has not placed any orders.
If this is a relational algebra question in the sense of just math, probably can't help. If it is a database question looking for a query, something like: select order.order# from order o left outer join shipment s on order.order# = shipment.order# where (shipment.ship_date is null and datediff(d, order.odate, getdate()) > 14) or datediff(d, order.odate, shipment.ship_date) > 14 select cname from (select cname, o.cust#, count(o.order#) from customer c left outer join order o on c.cust# = o.cust# group by cname, o.cust# having count(o.order#) = 0)
-
If this is a relational algebra question in the sense of just math, probably can't help. If it is a database question looking for a query, something like: select order.order# from order o left outer join shipment s on order.order# = shipment.order# where (shipment.ship_date is null and datediff(d, order.odate, getdate()) > 14) or datediff(d, order.odate, shipment.ship_date) > 14 select cname from (select cname, o.cust#, count(o.order#) from customer c left outer join order o on c.cust# = o.cust# group by cname, o.cust# having count(o.order#) = 0)
Much better for the second query:
select cname
from CUSTOMER c
left join [ORDER] o
on c.cust# = o.cust#
WHERE o.order# IS NULL========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
-
If this is a relational algebra question in the sense of just math, probably can't help. If it is a database question looking for a query, something like: select order.order# from order o left outer join shipment s on order.order# = shipment.order# where (shipment.ship_date is null and datediff(d, order.odate, getdate()) > 14) or datediff(d, order.odate, shipment.ship_date) > 14 select cname from (select cname, o.cust#, count(o.order#) from customer c left outer join order o on c.cust# = o.cust# group by cname, o.cust# having count(o.order#) = 0)
-
CUSTOMER (Cust#, Cname, City) ORDER (Order#, Odate, Cust#, Ord_Amt) ORDER_ITEM (Order#, Item#, Qty) ITEM (Item#, Unit_price) SHIPMENT (Order#, Warehouse#, Ship_Date) WAREHOUSE (Warehouse#, City) List the orders that were not shipped within 14 days of ordering. Produce a list of Cname who has not placed any orders.
Do not repost! List the orders that were not shipped within 14 days of ordering.[^]
-
CUSTOMER (Cust#, Cname, City) ORDER (Order#, Odate, Cust#, Ord_Amt) ORDER_ITEM (Order#, Item#, Qty) ITEM (Item#, Unit_price) SHIPMENT (Order#, Warehouse#, Ship_Date) WAREHOUSE (Warehouse#, City) List the orders that were not shipped within 14 days of ordering. Produce a list of Cname who has not placed any orders.
- ∏{order#} (∑{datediff(ODate,Today)>14} (REN o(ORDER) θ{o.order#=ons.order#} REN ons( ∏ {oredr#} (ORDER) - ∏ {oredr#} (SHIPMENT)))) 2) ∏{CName} (REN c(CUSTOMER) θ{c.Cust#=onp.Cust#} REN onp( ∏ {Cust#} (CUSTOMER) - ∏ {Cust#} (ORDER))) Operators used: ∑ is SELECT ∏ is PROJECT θ is THETA JOIN - is SET DIFFERENCE REN is RENAME {} is for enclosing expressions