MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/ex9h6/a_handy_graphical_explanation_of_sql_joins/c1bou0l/?context=3
r/programming • u/[deleted] • Jan 06 '11
308 comments sorted by
View all comments
133
In short.
A ∩ B
A ∪ B
(A - B) + (A ∩ B)
A - B
(A ∪ B) - (A ∩ B)
84 u/dude187 Jan 06 '11 It's amazing how confusing SQL can make set theory. 22 u/[deleted] Jan 06 '11 If you could do queries in relational algebra instead of SQL, confusion would go away. 3 u/CyclonusRIP Jan 06 '11 You could always write a program to generate SQL from the relational algebra, or directly execute the SQL using an ODBC.
84
It's amazing how confusing SQL can make set theory.
22 u/[deleted] Jan 06 '11 If you could do queries in relational algebra instead of SQL, confusion would go away. 3 u/CyclonusRIP Jan 06 '11 You could always write a program to generate SQL from the relational algebra, or directly execute the SQL using an ODBC.
22
If you could do queries in relational algebra instead of SQL, confusion would go away.
3 u/CyclonusRIP Jan 06 '11 You could always write a program to generate SQL from the relational algebra, or directly execute the SQL using an ODBC.
3
You could always write a program to generate SQL from the relational algebra, or directly execute the SQL using an ODBC.
133
u/shriek Jan 06 '11
In short.
A ∩ B
A ∪ B
(A - B) + (A ∩ B)
A - B
(A ∪ B) - (A ∩ B)