数据库中的三级模式结构
模式(Schema)是数据库中全体数据的逻辑结构和特征的描述,又称概念模式或概念视图。视图可理解为一组记录的值,用户或程序员看到和使用的数据库的内容。 模式处于三级结构的中间层,它是整个数据库实际存储的抽象表示,也是对现实世界的一个抽象,是现实世
模式(Schema)是数据库中全体数据的逻辑结构和特征的描述,又称概念模式或概念视图。视图可理解为一组记录的值,用户或程序员看到和使用的数据库的内容。
模式处于三级结构的中间层,它是整个数据库实际存储的抽象表示,也是对现实世界的一个抽象,是现实世界某应用环境(企业或单位)的所有信息内容集合的表示,也是所有个别用户视图综合起来的结果,所以又称用户共同视图。
所谓模式是指用数据描述语言精确定义的数据模型。数据模式的三个层次:外部层、概念层和内部层,构成数据库系统的三级模式结构,不管数据库管理系统的功能如何变化、操作系统的平台如何不同、数据模型如何不同等,数据库系统的三级模式结构的特征基本上保持不变。
外模式又称用户模式, 在传统的数据库系统中定义为子模式,子模式是概念模式的子集。外模式按用户视图定义数据,也可以从概念模式中导出。
概念模式又称逻辑模式, 是现实世界和数据存储之间的扭带。概念模式是为了实现数据库数据的共享进行数据库设计之后,得到的全局性数据逻辑关系的抽象和描述,它独立于数据的物理存储结构,是所有用户的共同的逻辑数据视图。
内模式又称物理模式,用以描述数据在数据库中的存储和存取方式。
DBMS 提供内模式描述语言(内模式 DDL)来定义内模式。
在数据库系统中,外模式可有多个,而概念模式、内模式只能各有一个。
内模式是整个数据库实际存储的表示,而概念模式是整个数据库实际存储的抽象表示.外模式是概念模式的某一部分的抽象表示。
所有的这些模式都必须在使用数据库之前进行定义。数据库管理系统提供模式描述语言 DDL,用以严格地描述一个数据库中所有实体的定义,经编译之后存储在数据库中。外模式是与每个具体的应用程序和它使用的高级编程语言相关联的。内模式与数据的物理存储(操作系统)和硬件有关。概念模式是独立于具体应用和物理环境的,是数据库中全体数据的逻辑表示。
数据库设计的过程就是综合外模式, 产生概念模式,根据使用的DBMS产生物理模式。再由概念模式导出用户视图, 就是用户看到的逻辑数据。
数据库的三级模式结构是对数据的三个抽象级别。在这三个抽象级别之间,为了实现数据的转换,数据库管理系统必须提供两层映射功能,即外模式和概念模式的映射,概念模式和内部模式的映射。
外模式和概念模式的映射,定义了外模式和概念模式之间的对应关系,通常在外模式中给出描述。这层映射的作用是实现逻辑数据的独立性。当数据的整体逻辑结构改变时,如果某个外模式保持不变,相应的外模式和概念模式的映射关系需要改变,因而该外模式对应的应用程序不用改变。
概念模式和内部模式的映射,存在于概念层,由DBMS建立两者之间的逐一对应关系。这层映射的作用是实现物理数据的独立性。当数据库的物理存储模式修改时,如改变存储设备和存取方法时,概念模式可以保持不变,相应的内模式和概念模式的映射关系需要改变,应用程序也不用改变。
三级结构的优点:
(1)保证数据的独立性。将模式和内模式分开,保证了数据的物理独立性;将外模式和模式分开,保证了数据的逻辑独立性。
(2)简化了用户接口。按照外模式编写应用程序或敲入命令,而不需了解数据库内部的存储结构,方便用户使用系统。
(3)有利于数据共享。在不同的外模式下可有多个用户共享系统中数据,减少了数据冗余。
(4)利于数据的安全保密。在外模式下根据要求进行操作,不能对限定的数据操作,保证了其他数据的安全。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Even answering calls in Do Not Disturb mode can be a very annoying experience. As the name suggests, Do Not Disturb mode turns off all incoming call notifications and alerts from emails, messages, etc. You can follow these solution sets to fix it. Fix 1 – Enable Focus Mode Enable focus mode on your phone. Step 1 – Swipe down from the top to access Control Center. Step 2 – Next, enable “Focus Mode” on your phone. Focus Mode enables Do Not Disturb mode on your phone. It won't cause any incoming call alerts to appear on your phone. Fix 2 – Change Focus Mode Settings If there are some issues in the focus mode settings, you should fix them. Step 1 – Open your iPhone settings window. Step 2 – Next, turn on the Focus mode settings

Go language is an efficient, concise and easy-to-learn programming language. It is favored by developers because of its advantages in concurrent programming and network programming. In actual development, database operations are an indispensable part. This article will introduce how to use Go language to implement database addition, deletion, modification and query operations. In Go language, we usually use third-party libraries to operate databases, such as commonly used sql packages, gorm, etc. Here we take the sql package as an example to introduce how to implement the addition, deletion, modification and query operations of the database. Assume we are using a MySQL database.

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

Lambda expression is an anonymous function without a name, and its syntax is: (parameter_list)->expression. They feature anonymity, diversity, currying, and closure. In practical applications, Lambda expressions can be used to define functions concisely, such as the summation function sum_lambda=lambdax,y:x+y, and apply the map() function to the list to perform the summation operation.

Analysis of the basic principles of the MySQL database management system MySQL is a commonly used relational database management system that uses structured query language (SQL) for data storage and management. This article will introduce the basic principles of the MySQL database management system, including database creation, data table design, data addition, deletion, modification, and other operations, and provide specific code examples. 1. Database Creation In MySQL, you first need to create a database instance to store data. The following code can create a file named "my

HTML cannot read the database directly, but it can be achieved through JavaScript and AJAX. The steps include establishing a database connection, sending a query, processing the response, and updating the page. This article provides a practical example of using JavaScript, AJAX and PHP to read data from a MySQL database, showing how to dynamically display query results in an HTML page. This example uses XMLHttpRequest to establish a database connection, send a query and process the response, thereby filling data into page elements and realizing the function of HTML reading the database.
