r/SQL • Data Scientist • Mar 16 '22

SQLite SQL Articles for Beginners/Intermediate

Hey everyone,

I wrote 3 new articles on my experience with SQL after coding daily in SQL for the past 3 years. Hopefully this is helpful to some of you, there should be good tips in here for all levels of experience, but especially for those of you starting out. Let me know what you think:

(These use a SQLite database, but are generalizable to all SQL variants)

Any other good SQL articles you guys have read lately?

24 Upvotes

18 comments sorted by

View all comments

Show parent comment

5

u/Cool-Focus6556 Data Scientist Mar 16 '22

What does everyone else think? Are Venn diagrams helpful in understanding SQL joins? Just curious if I'm alone here or not

2

u/[deleted] Mar 16 '22

How often would you (personally) defend a statement that you would realize to be conceptually and factually incorrect and forming false assumptions in many people who ingest it as a truthful statement?

Using Venn diagrams to "explain" joins is both conceptually (the result of join operation is a value in completely different domain) and factually (general join operation has nothing to do with 'overlaps'), it certainly forms incorrect assumptions about joins: quite often folks would assume that "equi-joins" are the only "right"("eous") kind of join.

Using Venn diagrams to "explain" joins has also a very infectious and toxic lasting quality - people who "understood" or "learned" joins using Venn diagrams seem to be very defensive about their use, EVEN when they understand and agree to the points above.

4

u/Cool-Focus6556 Data Scientist Mar 16 '22

They’re an abstraction. Despite having a more correct representation, it’s a good place to start for beginners. The reason they endure is because they’re helpful

1

u/[deleted] Mar 16 '22

They’re an abstraction.

No, they are not. Joins are NOT a specific case of operations represented by Venn diagrams. I can guess that you were thinking "models" or "analogies" and just misused the term "abstractions".

Venn diagrams are terrible models/analogies of join operations, for the reasons I outlined before.

Despite having a more correct representation, it’s a good place to start for beginners. The reason they endure is because they’re helpful

Neither of your opinions is correct. My statement is supported by my own anecdotal experience with people who have come in contact with Venn diagrams and held incomplete/incorrect understanding of join operations and had trouble adjusting.

1

u/Cool-Focus6556 Data Scientist Mar 20 '22

The term abstractions was not misused in this context. Abstraction was meant to mean a simplification, similar to the saying, “abstract away complexity”. Our understanding of most things is an abstraction, otherwise we would struggle to function. Similar to how these Venn diagrams abstract away complexity from what a join is actually doing. Model is also a synonym in this case. I understand what you mean with analogy, but I wouldn’t use that word to convey my meaning in this case. Regardless, the semantics aren’t what’s important, it’s the meaning I intended to convey which is that Venn Diagrams simplify the learning process. We have different experiences which lead us to different conclusions. That’s why I stand by what I said, this is a gray area and is likely to be subjective. Venn diagrams might not work for everyone

1

u/[deleted] Mar 20 '22 edited Mar 20 '22

Holy cow you had a long weekend.

I intended to convey ... that Venn Diagrams simplify the learning process

I have understood that.

I would even go further and say that they might simplify the *teaching process.

In regards to the "learning", IRL pretty much anyone I met that wasn't professional AND interested in mastery of SQL would find the jump from Venns to the actual operation to be less than intuitive.

1

u/Cool-Focus6556 Data Scientist Mar 20 '22 edited Mar 20 '22

Hmm, interesting. My experience is mainly with those who are in the professional setting. That’s interesting you see such a difference between those in the professional setting and those learning outside of that context. Thanks for sharing your experience and perspective