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
  • The Staggering Truth About These New Weight Loss Drugs — And Why You Need to Know

  • The Quiet Crisis: Why Your Auto Loan Interest Rates Are Still Skyrocketing

  • Elvis’s Ghost Haunts AI: The $41 Million Anthropic Copyright Lawsuit Explained

  • 7 Micro-SaaS Tools Quietly Transforming Freelance Productivity — Don’t Miss Out!

  • Who Really Owns the Moon? The Shocking Truth About Lunar Real Estate

  • 7 Shocking Ways Trophy Games’ Q3 2026 Earnings Reshape the Industry

  • The Trillion-Dollar Wall: 10 Urgent Steps to Protect Your CRE Investments Now

  • Mind-Blowing: AI in Law Will Unleash a 30% Deluge of New Cases

  • Slik leser du casinovurderinger utover poengsummen

  • Casinoomtaler som sammenligningsverktøy for ulike spillbehov

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

    3 Ways to Play Craps

    October 2, 2023
    By Matthew Lynch
  • How To

    How to Make Pupusas: 15 Steps

    November 6, 2023
    By Matthew Lynch
  • How To

    How to Code: 15 Steps

    November 13, 2023
    By Matthew Lynch
  • How To

    How to Flip Items for Profit Online

    December 12, 2023
    By Matthew Lynch
  • How To

    3 Ways to Get Beach Wavy Hair Without Heat

    February 28, 2024
    By Matthew Lynch
  • How To

    3 Ways to Measure a Lamp Shade

    November 14, 2023
    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.