Home> Common Problem> body text

What is the three-level schema structure of a database system?

青灯夜游
Release: 2023-02-16 16:58:25
Original
53413 people have browsed it

The three-level schema structure of the database system means that the database system consists of three levels: external schema, schema and internal schema. The schema, also called the logical schema, is the common data view for all users; the external schema, also called the user schema, is the data view of database users and is a logical representation of data related to an application; the internal schema, also called the storage schema, is the data within the database. of organization.

What is the three-level schema structure of a database system?

The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.

The three-level schema structure of the database system:

The three-level schema structure of the database system means that the database system is composed of external schema, schema and The internal schema is composed of three levels, as shown in the figure:

What is the three-level schema structure of a database system?

① Schema:

Schema is also called logical schema , is a description of the logical structure and characteristics of all data in the database, and is a public data view for all users.It is the middle layer of the database system schema structure. It does not involve the physical storage details of data, and has nothing to do with specific applications, application development tools and high-level programming languages used.

Schema is actually a logical view of database data. A database has only one schema. The database schema is based on a certain data model, comprehensively considers the needs of all users, and organically combines these needs into a logical whole. When defining a schema, it is not only necessary to define the logical structure of the data, such as which data items the data record consists of, the names, types, value ranges of the data items, etc.; it is also necessary to define the connection between the data, and define the security and integrity of the data. sexual requirements.

The database management system provides schema data definition language (schema DDL) to strictly define the schema.

②External schema (external schema):

External schema is also called subschema (subschema) or user schema. It is the database used for firmware. The description of the logical structure and characteristics of the local data that can be seen and used by(including application programmers and end users) is the data view of the database user and the logical representation of the data related to a certain application.

Foreign patterns are usually a subset of patterns. A database can have multiple foreign schemas. Since it is the data view of each user, if different users have differences in application requirements, ways of viewing data, and requirements for data confidentiality, their external schema descriptions will be different. Even for the same data in the schema, the structure, type, length, confidentiality level, etc. of the external schema can be different. On the other hand, the same foreign mode can also be used by multiple application systems of a certain user, but an application can only use one foreign mode.

Foreign mode is a powerful measure to ensure database security. Each user can only see and access the data in the corresponding foreign schema, and the rest of the data in the database is invisible.

③Internal schema:

Internal schema is also called storage schema. A database has only one internal schema. It is a description of how data is physically stored and stored, and how data is organized within the database.For example, whether the record storage method is heap storage, storage in ascending (descending) order of a certain attribute value(s), or cluster storage according to attribute values; in what way the index is organized, it is a B-tree index Or hash index; whether the data is compressed and stored, whether it is encrypted; what are the regulations for the storage record structure of the data, such as fixed-length structure or variable-length structure, a record cannot be stored across physical pages; etc.

(Recommended tutorial:

mysql video tutorial)

The above is the detailed content of What is the three-level schema structure of a database system?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!