A database schema is the structured blueprint that defines how data is organized inside a database.
It describes elements such as tables, columns, data types, relationships, indexes, and constraints. The schema determines how different pieces of information are stored and how they connect to each other.
Also known as: Database structure, relational schema, data schema.
A database schema defines the rules and organization of a database before or while data is stored.
It may specify:
For example, an e-commerce database may contain separate tables for customers, products, orders, and payments.
The schema determines how these tables relate to one another.
A database is the actual collection of stored data.
A database schema is the structure that defines how that data is organized.
In simple terms:
For example, a customer table may contain thousands of customer records, while the schema defines which fields the table contains.
A data model is a broader conceptual representation of how information should be organized.
A database schema is a more technical implementation of that model within a specific database system.
In simple terms:
A data model may describe customers and orders conceptually, while the schema specifies the exact tables, columns, keys, and data types.
A database schema defines the technical structure of stored data.
A data dictionary documents what the individual fields and structures mean.
In simple terms:
The two are often used together to make databases easier to understand and maintain.
A physical schema describes how data is stored at the system level.
It may include:
A logical schema defines tables, fields, relationships, and constraints without focusing on the underlying storage hardware.
This is the type developers most commonly work with.
A conceptual schema provides a high-level view of the main entities and relationships in a database.
For example, it may show that customers place orders and orders contain products.
Database schemas are important when storing structured data collected from websites or APIs.
For example, a product monitoring system may use a table with fields such as:
product_id
product_name
price
currency
availability
source
collected_at
The schema may define:
product_id: Integer
product_name: String
price: Decimal
currency: String
availability: Boolean
source: String
collected_at: Timestamp
This ensures that newly collected records follow a consistent structure before they are stored.