Self Join in SQL

Veröffentlicht am: 21 Mai 2021
auf dem Kanal: Database Star
62,984
1.6k

📝 Get my free SQL Cheat Sheets: https://databasestar.mykajabi.com/lpk...
🎓 Learn and become confident with SQL joins: https://databasestar.mykajabi.com/joi...

A self join in SQL is where you write a query on one table that joins to the same table a second time. It's used when you have a record in the table that refers to another record in the same table.

A common example is employees and managers, or product categories. Anything with a "hierarchical data" setup may use an SQL self join.

This video shows you what an SQL self join is, how to write one, and how to overcome issues with column names and missing data.

You can find out more about joins overall in this guide here: https://www.databasestar.com/sql-joins/

If you want more database training, practice questions, and guides, enroll in Database Star Academy here: https://www.databasestar.com/dsa/

If you have any suggestions for other videos or comments on this one, let me know in the comments below.

Timestamps:
00:00 Introduction
00:12 Self Join definition
01:38 Employee solution
06:03 Final query
06:45 Categories example
07:30 Left Join


Auf dieser Seite können Sie das Online-Video Self Join in SQL mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Database Star 21 Mai 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 62,984 Mal angesehen und es wurde von 1.6 tausend den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!