HexLibraryHexLibrary
</> HexCodeSign inSign up
PythonJavaScriptTypeScriptCC++JavaPHPGoRustRubyBashSQLLuaPerlCOBOLPascalDelphiFortranDartSwiftC#JuliaGroovyRElixirHaskellKotlinScalaClassic ASPClipperMS-DOS
LESSONS
Introduction to SQL (SELECT)Tables (CREATE & INSERT)Filtering (WHERE)Sorting & LimitingAggregate FunctionsUpdate & DeleteJoins (JOIN)
REFERENCE
📖 Overview
🔎 Querying (SELECT)
🗃️ Creating a Table
✏️ Inserting & Modifying Data
🧲 Filtering (WHERE)
🔢 Sorting & Limiting
📊 Aggregate Functions
🔗 Joins (JOIN)
INNER JOIN
SQL›REFERENCE›Joins (JOIN)
🔗

Joins (JOIN)

Relating two tables.

CommandDescription
INNER JOINJoins two tables on a common column.

INNER JOIN

Try it yourself →

Joins two tables on a common column.

Syntax

SELECT ... FROM a JOIN b ON a.x = b.y;

Description

Joins related tables (e.g., order + customer) on a common key and queries them together.

Example

CREATE TABLE person(id INTEGER, name TEXT);
CREATE TABLE orders(person_id INTEGER, item TEXT);
INSERT INTO person VALUES (1, 'Alex');
INSERT INTO orders VALUES (1, 'Pen');
SELECT person.name, orders.item FROM person JOIN orders ON person.id = orders.person_id;

Expected output

Alex|Pen

When to use?

Combining related data (multi-table queries).

HexLibraryHexLibrary

Learn programming more clearly. Every command is explained line by line with colors, reinforced with runnable exercises, test your code instantly — all in one place, free.

Learn

  • Home
  • Languages & Lessons
  • HexCode

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Use

Other Projects

  • HexToolz
  • Free Service Manuals
© 2026 HexLibrary · The clearest way to learn code