AI engineering glossary · SQL databases

What is self join?

Self join: A join of a table with itself, using aliases to treat it as two copies. It is used when rows relate to other rows of the same table, such as employees and their managers.

Level: intermediateTopic: SQL databases

Self join: an example

employees e JOIN employees m ON e.manager_id = m.id lists each employee beside their manager's name.

Related terms

More SQL databases terms

Where you learn it

Self join is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.