KOSUNI KOREA
Korean News in English
Technology

Mastering JOINs in MySQL: Connecting Multiple Tables

Published October 17, 2026 · 1 views
Mastering JOINs in MySQL: Connecting Multiple Tables


[Mysql 강좌] 10강 JOIN으로 여러 테이블 연결하기


Why Do You Need JOINs?

So far, we've only been querying single tables.

For example:

Member table

Or

Board table

But in real projects, you'll often need to combine information from multiple tables.

Consider a board system. A post has a title and content,

but it should also display the author's name.

To show both the post and author information,

you need to query both the post table and member table simultaneously.

This is where JOIN comes in handy.


Why Not Store Everything in One Table?

You might think it's simpler to store all information in one table,

like adding author name, email, and phone number directly into the post table.

But what happens when a member updates their name?

You'd have to modify hundreds of posts manually.

To avoid this problem, we divide data across multiple tables,

a process called Normalization.

We then use JOIN to connect the tables when needed.


Member Table and Board Table Example

Let's assume these table structures:

member table

id

name

1

Hong Gildong

2

Kim Cheolsu


board table

id

member_id

title

1

1

Learning MySQL

2

2

Learning SQL

The board table doesn't store author names,

only member_id references the member table.


What Is JOIN?

JOIN is a feature that lets you connect

different tables together as if they were one.

If author names are in the member table

and post titles in the board table,

you can retrieve both with a single JOIN operation.


Basic INNER JOIN Syntax

This is the most commonly used JOIN type.

SELECT *
FROM board
INNER JOIN member
ON board.member_id = member.id;

This SQL connects board and member tables

to retrieve both post information and author details.


Selecting Only Necessary Columns

In practice, you'll select specific columns instead of using *.

SELECT
board.title,
member.name
FROM board
INNER JOIN member
ON board.member_id = member.id;

The result will look like this:

Title

Author

Learning MySQL

Hong Gildong

Learning SQL

Kim Cheolsu

This is the typical format for board listings.


What Does ON Mean?

The most important part of JOINs.

ON board.member_id = member.id

This means

connect rows where board's member_id matches member's id.

This condition tells us which member wrote which post.


What Is LEFT JOIN?

LEFT JOIN retrieves all data from the left table,

including cases where there are no matching records in the right table.

For example, it can show members with no posts.

SELECT
member.name,
board.title
FROM member
LEFT JOIN board
ON member.id = board.member_id;

All members will appear in results,

and members without posts will show NULL for the title.


INNER JOIN vs LEFT JOIN

INNER JOIN

Shows only records that match between tables.

Member Exists

Post Exists

↓

Shown in Results


LEFT JOIN

Shows all records from the left table.

Member Exists

Post Doesn't Exist

↓

Member Still Shown

LEFT JOIN is frequently used in member management features.


Where Is JOIN Used in Boards?

JOINs are extensively used in board systems.

For example:

Board listings

Title
+
Author Name


Post details view

Post
+
Member Information


Comment listings

Comment Content
+
Member Name

This is how you combine multiple pieces of information together.


Using Aliases Makes It Easier

Table names can get long,

so it's common to use aliases for simplicity.

SELECT
b.title,
m.name
FROM board b
INNER JOIN member m
ON b.member_id = m.id;

We shortened board to b and member to m.

This is the most common format used in real-world applications.


Why Do People Find JOINs Difficult?

New learners often struggle with JOIN operations,

but the core concept is simple:

Connect tables using a common column.

For example:

member.id
↓
board.member_id

This is the connection point between the two tables.

Once you understand this principle,

JOINs aren't as difficult as they seem.


Practical Board Example

To display post number, title, author, and date:

SELECT
b.id,
b.title,
m.name,
b.created_at
FROM board b
INNER JOIN member m
ON b.member_id = m.id;

This is similar to what you'd use in a real board system.


Why Use JOINs?

Using JOINs helps because:

  • Reduces data duplication

  • Makes management easier

  • Allows for simpler modifications

  • Helps maintain data consistency

This is the main reason we divide databases into multiple tables.


Common Beginner Mistakes

1. Forgetting to specify ON conditions

With JOINs, you must always define which columns connect the tables.


2. Not distinguishing between same-named columns

If both tables have an 'id' column,

you need to specify which table's id you're using.


3. Using * instead of specific columns

In real work, it's better to select only the needed columns.


4. Storing all data in one table because JOINs seem difficult

This causes data duplication and management problems.

It's important to develop the habit of using JOINs properly.


Key Takeaways from This Lesson

Important points to remember:

  • JOIN connects multiple tables together.

  • INNER JOIN shows only matching records between tables.

  • LEFT JOIN retrieves all records from the left table.

  • ON defines the connection point between tables.

  • In practice, select only necessary columns.

  • JOINs are used in most projects like boards, member management, and e-commerce systems.

JOIN is often called the 'flower' of SQL because it's such an important feature.

If you understand this concept well,

you'll find database structures much easier to comprehend.


Wrapping Up

In today's lesson, we learned how to connect multiple tables using JOINs.

You're now ready to move beyond simple table queries and understand the database structures used in real services.

In our next session,

we'll design a practical board database structure using everything you've learned so far.

FAQ

What is the main purpose of using JOIN in SQL?

JOIN connects multiple tables together, allowing you to retrieve related data from different tables as if they were a single table. This avoids data duplication and makes database management more efficient.

When should I use INNER JOIN versus LEFT JOIN?

Use INNER JOIN when you only want records that exist in both tables (e.g., posts with authors). Use LEFT JOIN when you want to include all records from the left table, even if there are no matching records in the right table (e.g., showing all members regardless of whether they've posted anything).

Korean Source

This article is an English localization of a Korean-language report from BlogScore. Original: [Mysql 강좌] 10강 JOIN으로 여러 테이블 연결하기