- #1
SlurrerOfSpeech
- 141
- 11
In my opinion, using Venn diagrams, or set theory in general, to help aspiring SQL programmers (yes, SQL is a programming language) understand joins causes nothing but confusion for literal-, logical-thinking persons like myself. Allow me to explain my opinion.
Venn diagrams have always been used to show operations on sets of elements of the same type. SQL tables are not sets because they can contain repeated elements (identical rows). But let's pretend for a moment that they are sets. Still, an inner join, for example, doesn't necessarily make sense as an intersection because the two sets being intersected do not necessarily consist of the same types of elements. The following
A = { dog, cat, horse, lizard }
B = { cat, mule, hamster, dog }
A intersect B = { cat, dog }
simple example of an intersection makes sense because the sets have the same types of elements (animal names). A join is nothing like an intersection because A and B can be of different elements and the result can be an entirely new type of element.
By the way, you guys should add more prefixes so I don't have to arbitrarily tag this as C/#/++ in order to satisfy the prefix reguirment.
Venn diagrams have always been used to show operations on sets of elements of the same type. SQL tables are not sets because they can contain repeated elements (identical rows). But let's pretend for a moment that they are sets. Still, an inner join, for example, doesn't necessarily make sense as an intersection because the two sets being intersected do not necessarily consist of the same types of elements. The following
A = { dog, cat, horse, lizard }
B = { cat, mule, hamster, dog }
A intersect B = { cat, dog }
simple example of an intersection makes sense because the sets have the same types of elements (animal names). A join is nothing like an intersection because A and B can be of different elements and the result can be an entirely new type of element.
By the way, you guys should add more prefixes so I don't have to arbitrarily tag this as C/#/++ in order to satisfy the prefix reguirment.