Schema of the database

Source: Internet
Author: User

Three-level mode structure: External mode, mode, and internal mode

First, schema (schema)

Definition: Also known as logical mode, is a description of the logical structure and characteristics of all the data in the database, and is the public data view of all users.

Understand:

① a database has only one schema;

② is the view of database data at the logical level;

③ database schema is based on a data model;

④ defines the schema not only to define the logical structure of the data (such as which data items are composed of data records, the name, type, value range, etc.) of the data, and to define the security and completeness requirements associated with the data, and to define the connection between the data.

 Second, outer mode (External Schema)

Definition: Also known as sub-mode (subschema) or user mode, is a description of the logical structure and characteristics of local data that database users (including application and end users) can see and use, a data view of the database user, and a logical representation of the data associated with an application.

Understand:

① a database can have multiple external modes;

② external mode is the user view;

③ External mode is a powerful measure to ensure data security.

Three, internal mode (Internal schema)

Definition: Also known as the storage mode (Storage schema), it is a description of the physical structure and storage of the data, is the representation of the data within the database (for example, the storage of records is stored sequentially, stored in accordance with the B-tree structure, or by the hash method, the index is organized in what way; Whether the data is compressed, whether it is encrypted, and what the data storage record structure is.

Understand:

① a database has only one internal mode;

② A table may consist of multiple files, such as: Data files, index files.

It is a method of database management system (DBMS) to organize and manage data in database effectively.

The objectives are:

① to reduce data redundancy and realize data sharing;

② to improve access efficiency and improve performance.

  1. Conceptual model (conceptual schema)

Conceptual mode is a description of the logical structure of global data in database system, and it is a common data view of all users (application), this kind of description is an abstract description, it does not involve the specific hardware environment and platform, and is not related to the specific software environment.

The concept pattern mainly describes the concept record type and data of the data and the relationship between them, it also includes some semantic constraints between the data, and its description can be defined by the DDL language in the DBMS.

  2. External mode (External schema)

The external mode is also called the sub-mode (subschema) or user mode (users ' schema) it is the user's view of the data, that is, a part of the pattern that the user sees, it is deduced from the conceptual pattern, the conceptual mode gives the system global data description and the model gives the local description of each user. A conceptual pattern can have several out-of-the-way models, each of which is concerned only with the patterns that can mask a large amount of irrelevant information and facilitates data protection, and therefore is extremely beneficial to users. The relevant external schema description language (out-of-mode DDL) is available in the general DBMS.

  3. Internal mode (Internal schema)

The internal mode is also called the physical mode (physical schema), it gives the database physical storage structure and physical access methods, such as the file structure of data storage, index, cluster and hash access and access path, the physical nature of the internal model is mainly embodied in the operating system and file level, It does not go deep into the device level (such as disk and disk operations), but in recent years there has been a trend toward device-level development (such as raw disks, disk chunking technology, etc.), and the DBMS generally provides the relevant internal schema description Language (Internal-mode DDL).

The data schema gives the data frame structure of the database, and the data in the database is the real entity, but the data must be organized according to the structure described by the framework, and the database called the conceptual schema is the conceptual database (conceptual). Outside the schema is composed of a database called the user database, the schema is composed of a database called the physical database (physical databases), these three kinds of databases only the physical database is real in the computer external memory, The other two databases do not really exist in the computer, but are mapped by the physical database through the two mappings.

The three levels of the pattern reflect the pattern of three different environments and their different requirements, in which the model is at the lowest level, it reflects the data in the computer physical structure of the actual storage form, the conceptual mode is in the middle, it reflects the designer's data global logic requirements, the outer mode is at the outermost layer, It reflects the user's requirements for data.

The three-level mode of database system is the three level abstraction of data, it leaves the concrete physical implementation of data to physical mode, so that the user and the global designer can not care about the concrete implementation and physical background of the database, at the same time, it establishes the connection and transformation of the three-level pattern through the two-level mapping. So that the concept mode and the external model, although not physical, but also can be mapped to obtain its existence of the entity, while the two-level mapping also guarantees the data in the database system independence, that is, the physical organization of data changes and logical conceptual level changes, does not affect the user's external mode changes, It simply adjusts the mapping method without changing the user mode.

1. Conceptual mode-to-inner mode mapping

This mapping gives the correspondence between the global logical structure of the data in the conceptual pattern and the physical storage structure of the data, which is usually implemented by the DBMS.

2. Mapping from outside mode to concept mode

The concept pattern is a global schema the outside mode is the user's local mode, and a conceptual pattern can define multiple outer patterns, and each outer pattern is a basic view of the conceptual pattern. The mapping of the external mode to the conceptual pattern gives the correspondence between the external pattern and the conceptual model, which is generally implemented by the DBMS.

It should be noted that: (1) in order to ensure the independence of database logical data, the need to modify is : schema and external mode mapping.

(2) to ensure that the database logical data independence, need to modify is: . the mapping of patterns to internal patterns.

(3) in the database of three modes: mode and internal mode only one, the outer mode can have more than one.


Schema of the database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.