This guide shows step by step how to create a new database and tables with DB Browser for SQLite. Everything explained in simple words.
Important: At the very beginning, you must give the table a name, otherwise the “OK” button will remain grayed out!
1. Create a new database
- Start DB Browser for SQLite.
- Click on New Database and choose a location + filename, e.g.
customers.db
. - The “Create Table” window will open automatically.
2. Assign a table name
- Enter a name in the Table Name field at the top, e.g.
customers
oraddresses
. - Without a table name, the “OK” button remains grayed out.
3. Add fields
- Click on Add Field.
- Enter the column name (e.g.
ID
,Name
,FirstName
,Date
). - Select the Type:
INTEGER
= whole number (e.g. for IDs)TEXT
= text, phone numbers, dates in format YYYY-MM-DDREAL
= decimal numbers (e.g. prices)NUMERIC
= exact numbers, often for money amountsBLOB
= binary data (e.g. images, rarely needed)
4. Field options
- NN = Not Null → field cannot be empty
- PK = Primary Key → unique identifier of the row
- AI = Auto Increment → value increases automatically (e.g. for IDs)
- U = Unique → value must be unique (e.g. for email)
5. Collation (sorting behavior)
- BINARY = strict (case sensitive)
- NOCASE = ignores case
- RTRIM = ignores trailing spaces
Recommendation: Choose NOCASE
for names and places, BINARY
for IDs.
6. Index constraints
- Primary Key = main identifier of the table
- Unique = no duplicate values
Sorting in descending order is not done here, but later in an SQL query:
SELECT * FROM customers ORDER BY Date DESC;
7. Schema
- main = normal tables (always use this)
- temp = temporary tables, disappear when closing
8. Example table
This is how your first table could look:
CREATE TABLE "customers" ( "id" INTEGER PRIMARY KEY AUTOINCREMENT, "Name" TEXT NOT NULL COLLATE NOCASE, "FirstName" TEXT, "ZIP" TEXT, "City" TEXT, "Date" TEXT, -- Format YYYY-MM-DD "Phone" TEXT, "IBAN" TEXT UNIQUE );
Now you can fill the table with your own data either using your admin panel or directly in DB Browser.