Comment by petalmind
> Overusing DISTINCT to “Fix” Duplicates
I wrote a small tutorial (~9000 words in two parts) on how to design complicated queries so that they don't need DISTINCT and are basically correct by construction.
https://kb.databasedesignbook.com/posts/systematic-design-of...
Nice articles in there. Bookmarked.
Edit: it’s also actually a book!