# Tables, indexes and schema changes

Create application tables and indexes, then evolve their schema.

Source: https://particledb.ai/sql/ddl/

Create application tables and indexes, then evolve their schema.

## Example

```sql
CREATE TABLE docs_schema_tasks (id BIGINT PRIMARY KEY, status TEXT);
CREATE INDEX docs_schema_tasks_status ON docs_schema_tasks (status);
```

```sql
ALTER TABLE docs_schema_tasks ADD COLUMN title TEXT;
INSERT INTO docs_schema_tasks VALUES (1, 'pending', 'Review');
SELECT id, status, title FROM docs_schema_tasks;
```

## Behavior

Schema changes affect application queries and clients. Test migrations on representative data and plan a recovery path. Use `IF EXISTS` or `IF NOT EXISTS` only when the intended result is unambiguous. Check transactional DDL support for the exact command rather than assuming every schema change rolls back.

## Related

[SQL reference](/sql/overview/) · [Application guide](/guides/relational-data/) · [Troubleshooting](/guides/troubleshooting/)
