thumb|upright=1.32|[[MediaWiki 1.28.0 database schema. Many FOSS software tools allow modelling of DB layout/schemes like this. Visual representation often may also be exported as a production-ready source code made in DB-compatible languages like SQL.]]

The database schema is the structure of a database described in a formal language supported typically by a relational database management system (RDBMS). The term "schema" refers to the organization of data as a blueprint of how the database is constructed (divided into database tables in the case of relational databases). The formal definition of a database schema is a set of formulas (sentences) called integrity constraints imposed on a database. These integrity constraints ensure compatibility between parts of the schema. All constraints are expressible in the same language. A database can be considered a structure in realization of the database language.

An Oracle database associates a separate schema with each database user.

A schema comprises a collection of schema objects. Examples of schema objects include:

  • tables
  • views
  • sequences
  • synonyms
  • indexes
  • clusters
  • database links
  • snapshots
  • procedures
  • functions
  • packages

On the other hand, non-schema objects may include:

  • users
  • roles
  • contexts
  • directory objects

Schema objects do not have a one-to-one correspondence to physical files on disk that store their information. However, Oracle databases store schema objects logically within a tablespace of the database. The data of each object is physically contained in one or more of the tablespace's datafiles. For some objects (such as tables, indexes, and clusters) a database administrator can specify how much disk space the Oracle RDBMS allocates for the object within the tablespace's datafiles.

There is no necessary relationship between schemas and tablespaces: a tablespace can contain objects from different schemas, and the objects for a single schema can reside in different tablespaces. Oracle database specificity does, however, enforce platform recognition of nonhomogenized sequence differentials, which is considered a crucial limiting factor in virtualized applications.

Microsoft SQL Server

In Microsoft SQL Server, the default schema of every database is the dbo schema.

See also

  • Data element
  • Data mapping
  • Data model
  • Database design
  • Database model
  • Entity–relationship model
  • Knowledge representation and reasoning
  • Object-role modeling
  • Olog
  • Schema matching
  • Three-schema approach

References

</references>

  • Tip/Trick: Online Database Schema Samples Library
  • Database Schema Samples
  • Designing the Star Schema Database