Skip to Main Content
Learn SQL using MySQL in One Day and Learn It Well
book

Learn SQL using MySQL in One Day and Learn It Well

by Jamie Chan
April 2024
Intermediate to advanced content levelIntermediate to advanced
127 pages
2h 29m
English
Packt Publishing
Content preview from Learn SQL using MySQL in One Day and Learn It Well

Chapter 7: Selecting Data Part 3

 

We’ve covered quite a few data selection concepts in the last two chapters. Those two chapters focused mainly on selecting data from a single table.

 

In this chapter, we’ll learn to select and combine data from one or more tables.

 

Joins

 

Let’s start with joins.

 

Like the name suggests, a join is used to join data from different tables based on a related column between the tables.

 

The syntax for joining two tables is:

 

SELECT [table_names.]columns_names_or_other_information

FROM

left_table

JOIN / INNER JOIN / LEFT JOIN / RIGHT JOIN

right_table

ON

left_table.column_name = right_table.column_name;

 

There are three main types of joins in mySQL: inner join, left join and right join. These are represented ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

MySQL Crash Course

MySQL Crash Course

Rick Silva

Publisher Resources

ISBN: 9781836205678Supplemental Content