1

How to write relation algebra? Lets say you have the following 4 tables:

CLIENT(<u>ClientID</u>, ClientName, ClientPhone, ClientEmail, ClientDOB, ClientReferenceID)
DRIVER(<u>DriverID</u>, DriverName, DriverPhone, DriverEmail, DriverCity, DriverDOB)
RIDE(<u>RideID</u>, DriverID, ClientID, RideDate, RideTime, StartAddress, EndAddress, Fee, Tip)
RATING(<u>DriverID</u>, <u>ClientID</u>, RatingValue)

how would you Write a query to output the name and email of all clients and drivers. There should be just two columns in this output. I wrote it like this:

πClientName,ClientEmail (CLIENT) U πDriverName,Driver (DRIVER)

how would you Write a query to output the DriverID of all drivers who have never given a ride?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • I added the relational algebra tag. Take a look at the [tag wiki](http://stackoverflow.com/tags/relational-algebra/info) entry. The set operators. – nvogel Mar 11 '15 at 19:05
  • See [this](http://stackoverflow.com/a/24425914/3404097). – philipxy Dec 25 '15 at 06:00

0 Answers0