The Tech Edvocate

Top Menu

  • Advertisement
  • Apps
  • Home Page
  • Home Page Five (No Sidebar)
  • Home Page Four
  • Home Page Three
  • Home Page Two
  • Home Tech2
  • Icons [No Sidebar]
  • Left Sidbear Page
  • Lynch Educational Consulting
  • My Account
  • My Speaking Page
  • Newsletter Sign Up Confirmation
  • Newsletter Unsubscription
  • Our Brands
  • Page Example
  • Privacy Policy
  • Protected Content
  • Register
  • Request a Product Review
  • Shop
  • Shortcodes Examples
  • Signup
  • Start Here
    • Governance
    • Careers
    • Contact Us
  • Terms and Conditions
  • The Edvocate
  • The Tech Edvocate Product Guide
  • Topics
  • Write For Us
  • Advertise

Main Menu

  • Start Here
    • Our Brands
    • Governance
      • Lynch Educational Consulting, LLC.
      • Dr. Lynch’s Personal Website
      • Careers
    • Write For Us
    • The Tech Edvocate Product Guide
    • Contact Us
    • Books
    • Edupedia
    • Post a Job
    • The Edvocate Podcast
    • Terms and Conditions
    • Privacy Policy
  • Topics
    • Assistive Technology
    • Child Development Tech
    • Early Childhood & K-12 EdTech
    • EdTech Futures
    • EdTech News
    • EdTech Policy & Reform
    • EdTech Startups & Businesses
    • Higher Education EdTech
    • Online Learning & eLearning
    • Parent & Family Tech
    • Personalized Learning
    • Product Reviews
  • Advertise
  • Tech Edvocate Awards
  • The Edvocate
  • Pedagogue
  • School Ratings

logo

The Tech Edvocate

  • Start Here
    • Our Brands
    • Governance
      • Lynch Educational Consulting, LLC.
      • Dr. Lynch’s Personal Website
        • My Speaking Page
      • Careers
    • Write For Us
    • The Tech Edvocate Product Guide
    • Contact Us
    • Books
    • Edupedia
    • Post a Job
    • The Edvocate Podcast
    • Terms and Conditions
    • Privacy Policy
  • Topics
    • Assistive Technology
    • Child Development Tech
    • Early Childhood & K-12 EdTech
    • EdTech Futures
    • EdTech News
    • EdTech Policy & Reform
    • EdTech Startups & Businesses
    • Higher Education EdTech
    • Online Learning & eLearning
    • Parent & Family Tech
    • Personalized Learning
    • Product Reviews
  • Advertise
  • Tech Edvocate Awards
  • The Edvocate
  • Pedagogue
  • School Ratings
  • 2.3 Million Ricky Joy Sour Crush Candies Recalled: This One Detail Is a Parent’s Nightmare

  • The Staggering Startup Valuation Reset: Why Unicorns Are Vanishing

  • The Glaring Contradiction: Why Big Tech Is Shedding 128,536 Jobs While Investing Billions in AI

  • Insomniac’s Bold Move: The Truth Behind Marvel’s Wolverine Sabretooth ‘Romance’ That Stunned Fans

  • Explosive: ESIC Ban Juan Angulo For Life — The Unseen Crisis Gripping Dota 2

  • This Crucial New Bill Could Finally Fix Student Loan Forgiveness for Millions

  • Massive School Bans on AI: Are We Sacrificing Progress for Protection?

  • Autonomous AI Breaches: Anthropic Confirms Four Attacks and Weaponized Bots

  • Jaw-Dropping Footage: This Waymo Collision Has Everyone Talking

  • Hyundai’s Game-Changing EV Battery Technology: Why It Matters For Your Next Car

How To
Home›How To›Simple Ways to Join Three Tables in SQL

Simple Ways to Join Three Tables in SQL

By Matthew Lynch
April 6, 2024
0
Spread the love

Database management and querying are critical for modern businesses to manage and analyze their data effectively. In this article, we will discuss simple ways to join three tables in SQL (Structured Query Language), which is a standard language used to communicate with various database systems.

Understanding Joins in SQL

In SQL, joins are used to combine data from multiple tables based on a related column between these tables. There are several types of join operations available in SQL like INNER JOIN, OUTER JOIN (LEFT JOIN, RIGHT JOIN, FULL OUTER JOIN), and CROSS JOIN. We will focus on INNER JOIN and OUTER JOIN for this article.

1.Joining Three Tables Using INNER JOIN

INNER JOIN returns records that have matching values in both tables. Let’s consider three sample tables: Employees, Departments and Salaries.

Employees Table:

EmployeeID | FirstName | LastName | DepartmentID

———–+———–+———-+————-

1          | John      | Doe      | 1

2          | Jane      | Smith    | 2

Departments Table:

DepartmentID | DepartmentName

————-+—————

1            | HR

2            | Finance

Salaries Table:

EmployeeID | AnnualSalary

———–+————-

1          | 50000

2          | 60000

In order to join these three tables using INNER JOIN, follow the below query:

“`

SELECT Employees.FirstName, Employees.LastName, Departments.DepartmentName, Salaries.AnnualSalary

FROM Employees

JOIN Departments ON Employees.DepartmentID = Departments.DepartmentID

JOIN Salaries ON Employees.EmployeeID = Salaries.EmployeeID;

“`

The result will be:

FirstName | LastName | DepartmentName | AnnualSalary

———-+———-+—————+————-

John      | Doe      | HR            | 50000

Jane      | Smith    | Finance       | 60000

2.Joining Three Tables Using OUTER JOIN (LEFT JOIN)

LEFT JOIN returns all records from the left table (Employees), and the matched records from the right table (Departments and Salaries). If no match is found, NULL values are returned.

Using our previous example, let’s modify our query with a LEFT JOIN:

“`

SELECT Employees.FirstName, Employees.LastName, Departments.DepartmentName, Salaries.AnnualSalary

FROM Employees

LEFT JOIN Departments ON Employees.DepartmentID = Departments.DepartmentID

LEFT JOIN Salaries ON Employees.EmployeeID = Salaries.EmployeeID;

“`

The result will be the same as INNER JOIN since we don’t have any NULL values in this case. However, if there were employees without departments or salaries, they would still be displayed with NULL values in those columns.

Conclusion

In this article, we demonstrated simple ways to join three tables in SQL using INNER JOIN and OUTER JOIN (LEFT JOIN). Joining multiple tables helps consolidate information from various sources, making data analysis more effective and efficient for businesses.

Previous Article

3 Ways to Make a Friend Jealous

Next Article

How to Decorate a Study Table: 12 ...

Matthew Lynch

Related articles More from author

  • How To

    4 Ways to Cook Pinto Beans Quickly

    December 23, 2023
    By Matthew Lynch
  • How To

    4 Ways to Stay Focused on God

    October 22, 2023
    By Matthew Lynch
  • How To

    3 Ways to Store Firewood Outdoors

    October 14, 2023
    By Matthew Lynch
  • How To

    4 Ways to Do Black Magic

    October 3, 2023
    By Matthew Lynch
  • How To

    12 Simple Ways to Wear a Fanny Pack

    November 13, 2023
    By Matthew Lynch
  • How To

    4 Ways to Calculate Blood Volume

    January 30, 2024
    By Matthew Lynch

Search

Login & Registration

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Newsletter

Signup for The Tech Edvocate Newsletter and have the latest in EdTech news and opinion delivered to your email address!

About Us

Since technology is not going anywhere and does more good than harm, adapting is the best course of action. That is where The Tech Edvocate comes in. We plan to cover the PreK-12 and Higher Education EdTech sectors and provide our readers with the latest news and opinion on the subject. From time to time, I will invite other voices to weigh in on important issues in EdTech. We hope to provide a well-rounded, multi-faceted look at the past, present, the future of EdTech in the US and internationally.

We started this journey back in June 2016, and we plan to continue it for many more years to come. I hope that you will join us in this discussion of the past, present and future of EdTech and lend your own insight to the issues that are discussed.

Newsletter

Signup for The Tech Edvocate Newsletter and have the latest in EdTech news and opinion delivered to your email address!

Contact Us

The Tech Edvocate
910 Goddin Street
Richmond, VA 23231
(601) 630-5238
[email protected]

Copyright © 2026 Matthew Lynch. All rights reserved.