Question

how would you convert this Select query to relational algebra:

SELECT Student.Name, Result.Mark
FROM Student, Results
WHERE Student.ID = Results.ID AND Results.Code = 'G51DBS'

This is what I have but I'm not sure:

[σ{Student.Name}(Student)]∪[Π{Result.Makr}σ{Student.ID = Results.ID ∧ results.code = g51dbs}(Results)]
Was it helpful?

Solution

I think it should be like this:

∏Name,Mark (σResult.Code="G51DBS"(Student⋈Result))

You might want to look at this tutorial and for Natural join this

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top