S
Seoffix.com
Sign In Get Pro Membership

SQL & MariaDB

SQL: Multi-Table INNER and LEFT JOINs

Intermediate SQL 25 XP

SQL Joins Mastery

Joins combine rows from two or more tables based on a related column between them.

  • INNER JOIN: Selects records that have matching values in both tables.
  • LEFT JOIN: Returns all records from the left table, and the matched records from the right table.

Syntax

SELECT a.id, a.name, b.score
FROM users a
INNER JOIN scores b ON a.id = b.user_id;

Your Task

Write a query that selects ools.tool_name, categories.name AS category_name, and ools.views where category enabled = 1.

Hints

  1. Aliases like t and c keep queries concise
  2. JOIN on foreign key relationship
  3. Filter with WHERE on the category status

Your answer

This lesson is checked against the lesson rules. Your code is never run on our servers.

AI Code Explainer & Translator

Runs without any outside service.
 
Mark Complete & Earn XP
Earn 25 XP. Finish every lesson in the track to earn its certificate.
Sign in to earn XP