Database Principle Analysis (Fourth Edition)

My Opinions on Database Principles and Application Courses of Computer Science (Fourth Edition)

    1. Information, data, data processing and data management

Definition of information: Information is the abstract response of the human brain to the way things exist in the real world, the state of motion, and the connections between things. Information exists objectively, and humans consciously collect and process information

Information characteristics:

  1. From matter and energy
  2. Can perceive
  3. Can be stored, transferred, regenerated and processed

Definition of data

Data is a combination of recognizable symbols used to record information. It is a specific manifestation of information. For example, the information of a certain student can be represented by a set of data: S1, Zhao Yi, female, and computer.

(What I think here is that data and its semantics are inseparable. The same number represents different meanings in different scenarios. Simply taking out a set of data has no meaning. Information is the semantics of data. Explanation, that is, the above data has no meaning before it does not describe people. It is only when describing people who are given their original meaning, that is, explaining the meaning of these data in different scenarios.)

The representation of the data:

Many different data forms can be used to represent the same information, and the information does not change with the data form.

For example, I bought 10 books today. Here, 10 can be changed to ten or ten, without changing the information.

The representation of data includes numbers, text, graphics, images, sounds, etc.

The relationship between data and information can be expressed simply by a formula:

 Information = data + semantics

(Semantics here I simply understand that data is used to describe things in the real world and make him have value, that is, to describe a person who is tall, short, fat and thin and his basic current situation, then the data has semantics and becomes information)

1.2 The emergence and development of database technology

The development of the database has gone through three stages, namely manual management, file system and database system.

Features of the manual management stage: There is no special access device for data, no special management software, no data sharing or independence

File system stage characteristics: data is stored in file form for a long time, and the file system manages the data. There is a certain degree of independence between the program and the data, the form of the file is diversified, and the data has a certain degree of sharing

Features of database system stage:

Data structure, high degree of sharing, low redundancy, high independence, unified data management and control functions

Here the high data independence is to understand the two independence of the secondary image

Three-stage management body:

Manual management stage: managed by people

File system stage: managed by the file system

Database system stage: Managed by DBMS

Focus! ! ! ! ! ! ! Data independence

High data independence: that is, the data in the database and the application are independent of each other, that is, changes in the logical structure, storage structure and access mode of the data do not affect the application

(In the database system, the structure of the entire database can be divided into three levels: user logical structure, database logical structure, and physical structure. Data independence is divided into two levels: physical independence and logical independence)

Physical independence of data:

When the physical structure of the database (such as storage structure, access mode, external storage device) changes, the logical structure of the database is not affected by modifying the mapping. Furthermore, the user logic structure and application program do not need to be changed

(Database management system to manage data)

Logical independence of data:

When the logical structure of the database changes, the logical structure of the mapping user and the application need not be changed by modifying the mapping

The database management system provides the following four aspects of data control functions:

Data security control: prevent data leakage and destruction caused by illegal use of the database

Data integrity control: The system ensures the correctness, validity and compatibility of data by setting some constraints such as integrity rules

Concurrency control:

When multiple users access or modify data at the same time, the system can prevent incorrect data provided to users due to mutual interference, and prevent the database from being damaged

Data Recovery:

When the data in the database is incorrect or lost due to hardware failure of the computer system and other deliberate reasons, the system has the ability to restore the database from an error state to the correct state at a certain moment

 

 

1.3 The composition of the database system

Database system (DBS) refers to the system after the introduction of the database into the computer system

It is mainly composed of database, database user, computer hardware system and computer software system. Sometimes people refer to database system as database for short

Database (DB): refers to the collection of organized, shareable data and data objects stored in the computer (this collection is organized according to a certain data model, described and stored for a long time, and can be stored in a safe and reliable way. (For data retrieval and storage)

Characteristics of the database

  1. Organized
  2. Integration
  3. Sharing

user:

Database users are divided into three categories, namely the first category of users, the second category of users, and the third category of users.

The first category of users:

That is, end users, mainly management personnel at all levels who use the database, engineering and technical personnel and scientific research personnel, generally non-computer professionals

The second category of users:

Namely application programmers, application programmers are responsible for designing and writing applications for end users, as well as for debugging and installation.

The third category of users:

Namely database administrators, database administrators are individuals or work teams responsible for designing, establishing, managing and maintaining databases and coordinating user requirements for databases

Computer software system

Computer software systems mainly include operating systems, database management systems, application development tools and application systems

  1. Operating System OS
  2. Database Management System DBMS:

It is a large-scale system software for data management, and it is a core component of the database system. Software that replaces abstract logical data processing with concrete physical data in a computer

The main functions are:

  1. Data definition function
  2. Data manipulation function
  3. Database operation management function
  4. Database establishment and maintenance function
  5. Data communication interface
  6. Data organization storage management function

The composition of the DBMS

  1. Language compiler

1 is subdivided into the data definition language DDL compiler, and the data manipulation language DML compiler implements basic operations on the database.

Its type is subdivided into two categories, namely autonomous or self-contained and host.

  1. System operation control program
  2. System establishment and maintenance procedures
  3. Data Dictionary:

A data directory describing relevant information in the database.

  1. Application development tools
  2. operating system

1.4 The internal architecture of the database system

The three-level model structure of the database system:

Concept; mode is the description of the logical structure and characteristics of all data in the database

The internal architecture is divided into a three-level mode structure and a two-level image (from a logical point of view, for users, the external mode, the mode and the internal mode correspond to the general user mode, conceptual mode, and physical mode)

The three-level model structure is further divided into:

  • Outer mode

A database can contain multiple external modes, which are the description of the logical structure and characteristics of the part of the data that database users can see and allow to use (it is also called sub-mode or user mode, and it is the most important of the three-level structure). The outer layer, outer mode is generally a subset of the mode, the outer mode is also a powerful measure to ensure database security)

  • mode

A database has only one mode, which is the description of the logical structure and characteristics of all data in the database (it is the middle layer of the three-level mode structure, does not involve the physical storage details of the data and the hardware environment, and the specific applications and application development used. Tools and high-level programming languages ​​have nothing to do, only the description of the type (student number, name, age, department))

  • Inner mode

A database can only contain one, which is a description of the storage structure of the database (it is the innermost layer of the three-level structure, and it is also the layer close to the physical storage, that is, the layer related to the actual storage of data. Examples of storage Storage method (sequential storage, b+ tree storage), how the index is organized, whether the data is compressed, whether it is encrypted. It does not involve any specific constraints of the storage device, such as disk track capacity and physical block size)

I see: Through the analysis of the database three-level model structure, we can see that a database system actually only exists in the physical level database, that is, the internal model. In fact, one of the central tasks of the DBMS is to complete the conversion between the three-level database model. .

In a database system, there can be multiple external modes, while there can only be one mode and one internal mode. The internal mode is the representation of the actual storage of the entire database, while the mode is the abstract representation of the actual storage of the entire database, and the external mode is the logical mode. Abstract representation of a part

Secondary image:

The secondary image is provided by the DBMS between the tertiary structure. It is the secondary image that guarantees the high data independence in the database system, that is, logical independence and physical independence

  • External mode/mode image

The external mode/mode mapping ensures the logical independence between the data and the program (the mode describes the global logical structure of the data, while the external mode describes the local logical structure of the data. There can be any number of unified modes in the database. External mode, for each external mode, there is an external mode/mode image, which determines the correspondence between the local logical structure of the data and the global logical structure, such as the logical structure of the student (student number, name, gender) When a new attribute date of birth is added in, the logical structure of the student becomes (student number, name, gender, date of birth)

A database administrator makes corresponding changes to each external mode/mode image. This mapping function ensures that the local logical structure of the data remains unchanged (the external mode remains unchanged), that is, the date of birth is added, but if no data is added, the ones that come out are still added before The original logical structure of the data, and realize the independence between the data and the application)

(2) Mode/intra mode image

The mode/intra-mode mapping ensures the physical independence of the data (the mode/intra-mode mapping is unique, it determines the correspondence between the global logical structure of the data and the storage structure, and ensures that the change of the data storage structure does not affect the data Changes to the global logical structure, so that you do not have to modify the application)

The advantages of the three-level model and two-level image of the database system

  1. Ensure data independence
  2. Simplified user interface
  3. Facilitate data sharing
  4. Conducive to data security and confidentiality

1.5 The external architecture of the database system

  1. Single-user database system
  2. Master-slave structure database system
  3. Distributed database system
  4. Client/server database system
  5. Browser/server structure database system

1.6 Database Management System

1.6.1 The main functions of DBMS

  1. Data definition function
  2. Data manipulation function
  3. Database operation management

The control of the database by the DBMS is mainly achieved through four aspects: data security control, data integrity control, data concurrency control in a multi-user environment, and database recovery

  1. Database establishment and maintenance function
  2. Data communication interface
  3. Organizational storage and management of data

1.6.2 Composition of DBMS (Understanding)

1.6.3 DBMS data access process (emphasis)

DBMS access to data usually requires the following steps

  1. The user uses a specific data manipulation language to issue an access request to the DBMS
  2. The DBMS receives the request and translates the request interpretation into machine code instructions
  3. The DBMS sequentially checks the external mode, external mode/mode image, mode, mode/internal mode image and storage structure definition
  4. The DBMS performs necessary access operations on the storage database
  5. Receive results from database access operations
  6. Perform necessary processing on the results obtained, such as format conversion
  7. Return the processed result to the user

Guess you like

Origin blog.csdn.net/weixin_44127142/article/details/108725513