I have three schemas:
SUPPLIER(SNO,SNAME,STATUS,CITY)
PROJECT(JNO,JNAME,CITY)
SPJ(SNO,JNO,QTY)
The query is:
Get jno values for projects supplied to any Project in 'BOMBAY' by Supplier in 'DELHI'.
How do I write this query in Relational Algebra?
I have three schemas:
SUPPLIER(SNO,SNAME,STATUS,CITY)
PROJECT(JNO,JNAME,CITY)
SPJ(SNO,JNO,QTY)
The query is:
Get jno values for projects supplied to any Project in 'BOMBAY' by Supplier in 'DELHI'.
How do I write this query in Relational Algebra?
Aman, welcome to StackOverflow. Here's a possible answer:
WITH SSUPPLIER := SUPPLIER RENAME {SCITY := CITY}
PPROJECT := PROJECT RENAME {PCITY := CITY}
:
JOIN( SSUPPLIER, PPROJECT, SPJ )
WHERE PCITY = 'BOMBAY' AND SCITY = 'DELHI'
{ JNO }
(This is using the Tutorial D variety of Relational Algebra, as described in the textbooks of Chris Date & Hugh Darwen. I see that the given schemas are taken from those books.)
As Philipxy points out, it's a good idea to say what textbook you are using, and what variety of RA.