Schema and data

Create a table

Create a small table with a primary key and required columns before inserting any data.

8 minute lesson

~~~

You created the notes table when you made the database file. Now add a table for tags:

CREATE TABLE tags (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL UNIQUE
) STRICT;

The schema gives each tag an identifier, requires a name, and prevents duplicate tag names.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →