Learn About Schemas and Their Relationship to Databases

A schema is the blueprint of a database that ensures organization

Mixed race person watching light column in cloud of blocks
Colin Anderson / Getty Images

A database schema is a collection of metadata that describes the relations in a database. A schema is also described as the layout or blueprint of a database that outlines the way data is organized into tables.

A schema is normally described using ​Structured Query Language (SQL) as a series of CREATE statements that may be used to replicate the schema in a new database.

An easy way to envision a schema is to think of it as a box that holds tables, stored procedures, views and the rest of the database in its entirety.

One can give people access to the box, and the box's ownership can be changed as well. 

Types of Database Schema

There two types of database schema: 

  1. The physical database schema gives the blueprint for how each piece of data is stored in the database. 
  2. The logical schema gives structure to the tables and relationships inside of the database. Generally speaking, the logical schema is created before the physical schema.

Typically, database designers use data modeling to create a database schema based on the software that will interact with the database.

Format
mla apa chicago
Your Citation
Chapple, Mike. "Learn About Schemas and Their Relationship to Databases." ThoughtCo, Oct. 18, 2017, thoughtco.com/definition-of-a-schema-in-a-database-1019262. Chapple, Mike. (2017, October 18). Learn About Schemas and Their Relationship to Databases. Retrieved from https://www.thoughtco.com/definition-of-a-schema-in-a-database-1019262 Chapple, Mike. "Learn About Schemas and Their Relationship to Databases." ThoughtCo. https://www.thoughtco.com/definition-of-a-schema-in-a-database-1019262 (accessed October 24, 2017).