123 123 - 1 year ago 91
SQL Question

Is this SQL query equivalent to this relational algebra statement?

I have the following SQL query:

SELECT foo.a, bar.b, baz.c FROM foo
INNER JOIN bar ON bar.id = foo.bar_id
INNER JOIN baz ON baz.id = foo.baz_id
WHERE foo.z = 50;

I want to know if this is equivalent to this relational algebra statement.

π foo.a, bar.b, baz.c (foo) ⋈ bar.id = foo.bar_id (bar) ⋈ baz.id = foo.baz_id (baz) σ foo.z = 50

Answer Source

Yes, it's (your SQL Query) a representation for your relational statement.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download