Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
SQL Inner Join Basics
00:00
5 left

SQL Inner Join Basics

EasySQL · PostgreSQL

Problem

Can you do an inner join in SQL?

Demonstrate the query using the provided employees and departments tables. Return only employees with a matching department record.

Output

  1. One row per matched employee
  2. Columns: employee_id, employee_name, and department_name
  3. Sort by employee_id ascending

Schema

employees
ColumnTypeDescription
employee_idPKINTUnique employee identifier
employee_nameVARCHAR(100)Employee's full name
department_idINTReferenced department identifier
departments
ColumnTypeDescription
department_idPKINTUnique department identifier
department_nameVARCHAR(100)Department name
Tablesemployeesdepartments
Interviewer

Your question is SQL Inner Join Basics. Start with the requirements and the two tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.