SQLiteSQLite SQLITE_ERROR

SQLite: No Such Table

SQLite raises 'no such table' when the query references a table name that does not exist in the current database file. This is the SQLite equivalent of MySQL 1146 or PostgreSQL 42P01.

Example Query

SELECT * FROM sessions;
-- Fails if the sessions table was never created

Common Causes

  1. 1Querying before running CREATE TABLE (missing migration)
  2. 2Opening a different SQLite file than expected
  3. 3Attached database prefix missing (e.g. aux.sessions not sessions)

How to Fix It

List tables with .tables in the SQLite CLI or SELECT name FROM sqlite_master WHERE type='table'. Ensure your migration or schema setup script runs before any queries. Check that you are opening the correct .db file.

Need a reliable database?

Try Supabase — free PostgreSQL with a generous free tier. No credit card required.

Get started free →

Got a query causing this error?

Paste it into SQLbuddy and get an instant plain-English explanation with optimization tips.

Analyze My Query →