Databases

Schema

The structure that defines how data is organised in a database: tables, columns, data types, constraints, relationships, and indexes.

In SQL databases, a schema is both a logical namespace (a container for objects like tables and views within a database) and the overall design of how those objects relate. Schema design determines query performance, data integrity, and how easily the application can evolve. A schema migration changes the structure - adding a column, creating an index, altering a constraint - and must be coordinated with the application code that depends on it. In PostgreSQL, 'schema' specifically means a namespace within a database (the default is 'public'). In SQL Server, schemas also serve as security boundaries for permissions.

Explained in depth

Implemented by

Learn it in context

Related concepts