SQL Join Venn Diagrams

Venn Diagram for SQL Inner Join

Coding Horror offers a primer on SQL JOINs using set theory’s Venn diagrams.

Venn diagrams are a very convenient mechanism for visualizing the union and intersection of two sets. Think of each table in a database a set. This primer illustrates how various SQL JOINs between tables can be visualized as unions and intersections.

The difficulty (which an earlier attempt at this by another blogger ran into) with this idea is that SQL JOINs can generate results that don’t make sense from a set theory perspective. Even the article I’m linking to here depends on the tables being joined not having duplicate data in the joined fields.

Via: Coding Horror: A Visual Explanation of SQL Joins
[tags]sql, join, set theory, venn diagram, primer[/tags]

| Print This Post Print This Post

Leave a Reply

You must be logged in to post a comment.

Sponsored Links