What are Semi, Anti, and Natural Joins in SQL?

DataMantra
2 min readFeb 13, 2024

--

We all have heard of LEFT JOIN, RIGHT JOIN, INNER JOIN, and OUTER JOIN, haven’t we?

This visual from ByteByteGo neatly summarizes them:

Here’s a short description:

  • Inner Join: Returns only matching rows from both tables.
  • Left Join: Returns all rows from the left table and matching rows from the right. Non-matching rows from the left table contain null values.
  • Right Join: Returns all rows from the right tables and matching rows from the left. Non-matching rows from the right table contain null values.
  • Full Outer Join: Returns all rows when there is a match in either table. Non-matching rows contain null values.

These four are the most prevalent types of SQL joins.

If you liked this post, don’t forget to leave a like

Happy Learning!

Looking to take your data analytics skills to the next level? Explore DataMantra’s cutting-edge courses to empower professionals with the knowledge and expertise needed to thrive in today’s data-driven world. From beginner to advanced levels, our comprehensive programs cover everything about data analysis.

Explore DataMantra’s comprehensive courses and start your journey to mastering data analytics today at Datamantra.com

reach out to us at: hello@thedatamantra.com

--

--

DataMantra
DataMantra

Written by DataMantra

DataMantra is an Edtech platform and founded by Tarun Sachdeva who is based out of Belgium and specialised in Tableau, SQL, ML, Python, Deep Learning & Gen AI.

No responses yet