From the course: SQL for Non-Programmers

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

From Equijoins to Inner Joins

From Equijoins to Inner Joins - SQL Tutorial

From the course: SQL for Non-Programmers

From Equijoins to Inner Joins

An Equijoin uses basic SQL commands SELECT, FROM, and WHERE to join two or more data tables that are related to each other. An Equijoin belongs to the broader inner join family, the most commonly used join in SQL. Let's move over to SLS and see how else we can use an inner join when working with data. Let's begin with the same query we used before. We were extracting a report from management that shows how many employees are in each sales role, and the total sales per role. Let's type it out together and review. We're going to start in the first section, SELECT job title, comma. Go to the next line. COUNT DISTINCT employee ID as employee count, comma. Next line. SUM order total as total sales. These are the different data pieces needed for the report. If we go to the next line, we're going to add FROM oliveoil.employees, comma, oliveoil.sales, pulling from both the employees table and the sales table. On the next line, we're going to add WHERE oliveoil.employees.id equals…

Contents