Menu

FULL OUTER JOIN in SQL
📰

FULL OUTER JOIN in SQL

DEV Community: datascience·Dennis Wachira·3 days ago
#tBHpHkey
#devtodatascience#science#devto#dev#join
Reading 0:00
15s threshold

A FULL OUTER JOIN combines the behaviour or of both LEFT JOIN and RIGHT JOIN . It returns:

All matching records from both tables.

Records from the left table that have no match.

Records from the right table that have no match.

Whenever a match doesn't exist, SQL fills the missing values with NULL .

For this exercise, I joined the visits and doctors tables to display hospital visit IDs together with the responsible doctor's name. The goal was to understand how SQL preserves records from both tables while still connecting related data whenever a match is available. Because I had already normalized my database and established proper relationships, every visit had a matching doctor.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.