%% generate tags start %% #software-engineering %% generate tags end %% #software-engineering/database ![(4) You don't* need JOINs - YouTube](https://www.youtube.com/watch?v=5hsl47I3svw) ## Summary - ==Subqueries== can be used instead of joins in certain cases to avoid duplication and improve performance. ## Highlights - 💡 Using subqueries to filter data from one table based on related data from another table without needing to return the related data. - 💡 Avoiding unnecessary duplication and de-duplication by using subqueries instead of joins. - 💡 My SQL 8.07 introduced semi-join and anti-join optimizations for subqueries, making them performant and efficient. - 💡 Subqueries can be faster than joins, especially when filtering on related data without needing to retrieve it. - 💡 Choosing the appropriate method (join or subquery) based on the need for related data in the final results.