Relational algebra nicely describes the various operations that we know in SQL as well from a more abstract, formal perspective. One of the most common relational JOIN operations is the "equi-join" or SQL INNER JOIN. The above example "equi-joins" the ACTOR, FILM_ACTOR, and FILM tables from the Sakila database, in order to produce a new … Continue reading Semi Join and Anti Join Should Have Their Own Syntax in SQL
Tag: anti-join
NOT IN vs. NOT EXISTS vs. LEFT JOIN / IS NULL: MySQL
When you're spoiled with Oracle's fabulous query transformation capabilities and its really well-done cost-based optimiser, then you might forget how difficult SQL query tuning used to be in the "old days" or with those less sophisticated databases. Here's a really nice explanation of the various means of implementing an ANTI-JOIN in MySQL: http://explainextended.com/2009/09/18/not-in-vs-not-exists-vs-left-join-is-null-mysql/
Advanced SQL: Relational division in jOOQ
Relational algebra has its treats. One of the most academic features is the relational division. It is hardly ever used, but comes in handy every now and then. And when you need it, you'll probably hate yourself for having slept during the relevant classes at the university. What is relational division? Relational division is the … Continue reading Advanced SQL: Relational division in jOOQ