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
CREATE TABLE
✏️ Inserting & Modifying Data
🧲 Filtering (WHERE)
🔢 Sorting & Limiting
📊 Aggregate Functions
🔗 Joins (JOIN)
SQL›REFERENCE›Creating a Table
🗃️

Creating a Table

Defining data structure.

CommandDescription
CREATE TABLECreates a new table.

CREATE TABLE

Try it yourself →

Creates a new table.

Syntax

CREATE TABLE name (column type, ...);

Description

Defines a table with column names and types. Common types: INTEGER, TEXT, REAL. PRIMARY KEY is the primary key.

Example

CREATE TABLE item (id INTEGER PRIMARY KEY, name TEXT, price REAL);
INSERT INTO item VALUES (1, 'Pen', 5.5);
SELECT name, price FROM item;

Expected output

Pen|5.5

When to use?

Setting up the database schema.

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