# SQLite: table X has no column named Y

**Code:** `no column` · **Category:** SQL · **Seen on:** SQLite, Python, Node.js

An INSERT/UPDATE names a column that isn't in the table (often after a schema change or wrong file).

## Meaning

Compare the table schema (`.schema table`) with your code, run pending migrations (ALTER TABLE ADD COLUMN), and make sure you opened the correct .db file. SQLite doesn't auto-migrate.

## Common causes

- Migration not applied
- Old database file
- Typo in column name
- ORM model ahead of the schema
- Dropped/renamed column

## Quick fix

1. Check `PRAGMA table_info(table)`
2. Apply the migration `ALTER TABLE t ADD COLUMN c TEXT`
3. Use the right database file

## Detailed fix by platform

### SQL

1. 

```sql
PRAGMA table_info(users);
ALTER TABLE users ADD COLUMN phone TEXT;
```


## How to diagnose

1. **Schema** — Has the column?
2. **Migration** — Applied?
3. **File** — Correct?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/sql/sqlite-table-has-no-column-named)
