Day 22 of My Data Analytics Journey !

Today I explored SQL Joins – one of the most important concepts in relational databases and also practiced with some coding problems on HackerRank.

Types of Joins

INNER JOIN → Returns only the matching rows from both tables.

LEFT JOIN → …


This content originally appeared on DEV Community and was authored by Ramya .C

Today I explored SQL Joins – one of the most important concepts in relational databases and also practiced with some coding problems on HackerRank.

Types of Joins

  1. INNER JOIN → Returns only the matching rows from both tables.
  2. LEFT JOIN → Returns all rows from the left table + matched rows from the right table.
  3. RIGHT JOIN → Returns all rows from the right table + matched rows from the left table.
  4. FULL JOIN (or OUTER JOIN) → Returns all rows when there is a match in one of the tables.

Among these, the most commonly used is the INNER JOIN.

✅ INNER JOIN Example

Let’s say we have two tables:

movies

movie_id movie_name
1 Ghajini
2 Singam
3 Kaakha Kaakha

actors

actor_id actor_name
1 Surya
2 Asin
3 Jyothika

movie_actors

movie_id actor_id
1 1
1 2
3 1
3 3

📝 Query (INNER JOIN)

SELECT m.movie_name, a.actor_name
FROM movies m
INNER JOIN movie_actors ma ON m.movie_id = ma.movie_id
INNER JOIN actors a ON ma.actor_id = a.actor_id;

Output

movie_name actor_name
Ghajini Surya
Ghajini Asin
Kaakha Kaakha Surya
Kaakha Kaakha Jyothika


This content originally appeared on DEV Community and was authored by Ramya .C


Print Share Comment Cite Upload Translate Updates
APA

Ramya .C | Sciencx (2025-08-20T18:33:49+00:00) Day 22 of My Data Analytics Journey !. Retrieved from https://www.scien.cx/2025/08/20/day-22-of-my-data-analytics-journey/

MLA
" » Day 22 of My Data Analytics Journey !." Ramya .C | Sciencx - Wednesday August 20, 2025, https://www.scien.cx/2025/08/20/day-22-of-my-data-analytics-journey/
HARVARD
Ramya .C | Sciencx Wednesday August 20, 2025 » Day 22 of My Data Analytics Journey !., viewed ,<https://www.scien.cx/2025/08/20/day-22-of-my-data-analytics-journey/>
VANCOUVER
Ramya .C | Sciencx - » Day 22 of My Data Analytics Journey !. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/08/20/day-22-of-my-data-analytics-journey/
CHICAGO
" » Day 22 of My Data Analytics Journey !." Ramya .C | Sciencx - Accessed . https://www.scien.cx/2025/08/20/day-22-of-my-data-analytics-journey/
IEEE
" » Day 22 of My Data Analytics Journey !." Ramya .C | Sciencx [Online]. Available: https://www.scien.cx/2025/08/20/day-22-of-my-data-analytics-journey/. [Accessed: ]
rf:citation
» Day 22 of My Data Analytics Journey ! | Ramya .C | Sciencx | https://www.scien.cx/2025/08/20/day-22-of-my-data-analytics-journey/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.