Create a Table

Time to build your own world! In this lesson, you’ll create your first SQL table—a place to store structured data.

Goal

You’ll aim to:

  • Use CREATE TABLE to define a table.

  • Set column names and types.

  • Understand table schemas.

Basic table creation

This table will have four columns, each with a specific data type:

  • id: A unique number (INTEGER).

  • title: The name of the book (TEXT).

  • author: Who wrote it (TEXT).

  • pages: The number of pages (INTEGER).

The books table

This table contains basic book information, including the title, author, and number of pages for each book.

Get hands-on with 1400+ tech skills courses.