SQL Exercises

PostgreSQL: Advanced SQL INNER JOIN Exercises

0 Exercises
~0 min

This guide is specifically for PostgreSQL syntax.

Advanced-level SQL INNER JOIN practice exercises with solutions.

Exercise 1

Question: List employees with their manager's name using a self-join.

SELECT e.name AS employee, m.name AS manager FROM employees e INNER JOIN employees m ON e.manager_id = m.id;

A self-join joins a table to itself. Use different aliases to distinguish between the two instances of the same table.


PostgreSQL-Specific Notes

This page covers PostgreSQL syntax. Other databases may have different syntax for similar operations.

Related Content

From Our Blog

Ready for more practice?

Join SQL Mastery and get access to interactive exercises, quizzes, and more.