Database Design Book
kb.databasedesignbook.com·1d
🗄️Database Design
Preview
Report Post

Posts

A modern guide to SQL JOINs

Author: Alexey Makhotkin squadette@gmail.com. There are many SQL JOINs guides and tutorials, but this one takes a different approach. We try to avoid misleading wording and imagery, and we structure the material in a different way. The goal of this article is to clarify your mental model. (~6600 words) Table of contents Prerequisites Starting with LEFT JOIN Use canonical syntax Use only ID equality in ON condition “Learning foreign language” metaphor Example dataset: employees/payments LEFT JOIN: N:1 case N:1, 1:N, and M:N cases SQL may be too permissive LEFT JOIN: 1:N case Why you should only use ID equality Self-join Fully general LEFT JOIN algorithm Things to remember, pt.

[read more](…

Similar Posts

Loading similar posts...