Write queries in the Relational Algebra (RA) for each of the following:
SELECT address FROM Patient WHERE name = "D.Z.Spells";
SELECT name
FROM Patient P, Treated T
WHERE P.PID = T.PID AND
Tdate = "1-June-2002";
SELECT PID FROM Treated WHERE Tcode='000100';
SELECT Tdescription
FROM Patient P, Treated D, Treatment T
WHERE P.PID = D.PID AND
D.Tcode = T.Tcode AND
P.name = "N.Welle";
SELECT Tdescription
FROM Treatment
WHERE Tfee >= ALL
(SELECT Tfee
FROM Treatment);
SELECT T1.Tcode
FROM Treatment T1
WHERE NOT EXISTS
(SELECT T2.PID
FROM Treatment T2
WHERE
T2.Tdate = '9-June-2002')
MINUS
(SELECT T3.PID
FROM Treatment T3
WHERE
T1.Tcode = T3.Tcode AND
T3.Tdate = '9-June-2002');
The descriptions of the treatments received by the patient who received the most treatments in the month of February, 2002, in alphabetical order.
SELECT T1.Tdescription
FROM Treatment T1
WHERE
Tcode IN
(SELECT T2.Tcode
FROM Treated T2
WHERE Tdate LIKE '%-February-2002'
GROUP BY Tcode
HAVING COUNT(*) >= ALL
(SELECT COUNT(*)
FROM Treated
GROUP BY Tcode)
);