Database schema

From Simple English Wikipedia, the free encyclopedia
The database schema of MediaWiki

In computer science a schema or database schema describes the structure of a database in a formal language that is supported by the database management system. Using the database schema, it is possible to create a blueprint of the database. This blueprint will not contain any data. The database schema uses logical formulas to create integrity constraints. It is not possible to insert data into the database that violates these integrity constraints. All contraints use the same language.

There are different kinds of database schemas:

  • The conceptual schema expresses the concepts in the database, and how they relate to each other
  • The logical schema is a mapping of entities with their attributes, and the respective relations
  • The physical schema is a particular implementation of a logical schema.

Ideally, a database schema should have the following properties:

  • It should be complete: all information in the source should be included.
  • It should be minimal: it should not be possible to leave out a relation, without losing information
  • It should be normalized: A certain piece of information should be in the schema only once.