A database schema (// SKEE-mə) of a database system is its structure described in a formal language supported by the database management system (DBMS) and refers to the organization of data as a blueprint of how a database is constructed (divided into database tables in case of Relational Databases). The formal definition of 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. The states of a created conceptual schema are transformed into an explicit mapping, the database schema. This describes how real world entities are modeled in the database.
"A database schema specifies, based on the database administrator's knowledge of possible applications, the facts that can enter the database, or those of interest to the possible end-users." The notion of a database schema plays the same role as the notion of theory in predicate calculus. A model of this “theory” closely corresponds to a database, which can be seen at any instant of time as a mathematical object. Thus a schema can contain formulas representing integrity constraints specifically for an application and the constraints specifically for a type of database, all expressed in the same database language. In a relational database, the schema defines the tables, fields, relationships, views, indexes, packages, procedures, functions, queues, triggers, types, sequences, materialized views, synonyms, database links, directories, XML schemas, and other elements.
Schemas are generally stored in a data dictionary. Although a schema is defined in text database language, the term is often used to refer to a graphical depiction of the database structure. In other words, schema is the structure of the database that defines the objects in the database.
In an Oracle Database system, the term "schema" has a slightly different connotation.
Ideal requirements for schema integration
All information in the source data should be included in the database schema.
Each of the overlapping elements specified in the input mapping is also in a database schema relation.
Extended overlap preservation
Source-specific elements that are associated with a source’s overlapping elements are passed through to the database schema.
Independent entities and relationships in the source data should not be grouped together in the same relation in the database schema. In particular, source specific schema elements should not be grouped with overlapping schema elements, if the grouping co-locates independent entities or relationships.
If any elements of the database schema are dropped then the database schema is not ideal.
These requirements influence the detailed structure of schemas that are produced. Certain applications will not require that all of these conditions are met, but these five requirements are the most ideal.
Example of two schema integrations
Example: Suppose we want a mediated (database) schema to integrate two travel databases, Go-travel and Ok-travel.
Go-travel has three relations:
Go-flight(f-num, time, meal)
Go-price(f-num, date, price)
f-num is the flight number and meal is a boolean.
Ok-travel has just one relation:
Ok-flight(f-num, date, time, price, nonstop)
'nonstop' is a boolean.
The overlapping information in Ok-travel’s and Go-travel’s schemas could be represented in a mediated schema:
Flight(f-num, date, time, price)
Oracle database specificity
In an Oracle database, associated with each database user is a schema. A schema comprises a collection of schema objects. Examples of schema objects include:
- database links
On the other hand, non-schema objects may include:
- 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.
||This "see also" section may contain an excessive number of suggestions. Please ensure that only the most relevant suggestions are given and that they are not red links, and consider integrating suggestions into the article itself. (July 2013)|
- Core Architecture Data Model
- Data Definition Language
- Database Design
- Data dictionary
- Data element
- Data model
- Data modeling
- Data mapping
- Database integrity
- entity-relationship model
- Knowledge Representation
- Object-Role Modeling
- Relational algebra
- Schema Matching
- Three schema approach
- Rybinski, H. (1987). On First-Order-Logic Databases. ACM Transactions on Database Systems, 12( 3), 325-349.
- Imielinski T., & Lipski W.(1982). A systematic approach to relational database theory. In Proceedings of the 1982 ACM SIGMOD international conference on Management of data (SIGMOD '82). ACM, New York, NY, USA, 8-14. DOI=10.1145/582353.582356 http://doi.acm.org/10.1145/582353.582356
- Pottinger P., & Berstein P.(2008). Schema merging and mapping creation for relational sources. In Proceedings of the 11th international conference on Extending database technology: Advances in database technology (EDBT '08). ACM, New York, NY, USA, 73-84. DOI=10.1145/1353343.1353357 http://doi.acm.org/10.1145/1353343.1353357
- Ashdown, Lance; Kyte, Tom (February 2010). Oracle Database Concepts 11g Release 2 (11.2). et al. Oracle Corporation. Retrieved 2010-04-14. "A database schema is a logical container for data structures, called schema objects. Examples of schema objects are tables and indexes."
- Oracle Database Concepts 10g Release 2 (10.2)Part Number B14220-02. Retrieved 2012-11-26. "A schema is a collection of logical structures of data, or schema objects. A schema is owned by a database user and has the same name as that user. Each user owns a single schema. Schema objects can be created and manipulated with SQL."
- Ashdown, Lance; Kyte, Tom (February 2010). Oracle Database Concepts 11g Release 2 (11.2). et al. Oracle Corporation. Retrieved 2010-04-14. "Other types of objects are also stored in the database and can be created and manipulated with SQL statements but are not contained in a schema. These objects include database users, roles, contexts, and directory objects."