Chapter One Introduction to Databases

1.1_Overview of database system

1.1.1_ Four basic concepts of database

1. Data (data)
2. Database (database, DB)

Database provides data storage function

3. Database management system (database management system, DBMS)

Main functions:
①Data definition function
②Data organization, storage and management
③Data manipulation function
④Database transaction management and operation management
⑤Database establishment and maintenance function

4. Database system (DBS)

A database system is a system for storing, managing, processing and maintaining data composed of databases, database management systems (and their application development tools), applications and database administrators
Insert picture description here

1.1.2_ Characteristics of database system

1. Data structure

Is the essential difference between database system and file system

2. High data sharing, low redundancy and easy to expand

Benefits of data sharing:
①Reduce data redundancy and save storage space
②Avoid incompatibility and inconsistency between data ③Make
the system easy to expand

3. High data independence

Data independence is guaranteed by the secondary image function of the DBMS.
Data independence includes physical independence and logical independence:
①Physical independence: refers to the fact that the user's application program and the physical storage of the data in the database are independent of each other
②Logic independence: refers to the user's application program and the logical structure of the database are mutually independent independent

4. The data is uniformly managed and controlled by the database management system

Data control functions provided by DBMS:
①Data security (Security) protection
②Data integrity (Integrity) check
③Concurrency control
④Database recovery (Recovery)

Insert picture description here

1.2_Database model

Data model is used to describe data, organize data and operate on

1.2.1_ Two types of data models

Conceptual model : also known as information model, it is based on the user's point of view to model data and information for database design.
Logical model and physical model :
Logical model mainly includes mesh model, hierarchical model, relational model, object-oriented model, etc., according to the point of view of the computer system to model data for DBMS implementation.
The physical model is an abstraction of the lowest level of data, describing the representation and access methods of data in the system, and the storage and access methods on disks or tapes.

1.2.2_ Conceptual model

Basic concepts: entity, attribute, code, domain, entity type, entity set,
a representation method of the connection conceptual model : entity-connection method (ER method), using ER diagram to describe the conceptual model of the real world
, ER method is also called ER model

1.2.3_ The components of the data model

The data model usually consists of three parts: data operation, data structure, and data integrity constraints

1.2.4_ Commonly used data models

Non-relational model
Hierarchical Model (Network Model)
Relational Model
(Object Oriented Model)
Object Relational Model (Object Relational Model)

Relationship model:

Relation
A relationship corresponds to a row in a
tuple
table, which is usually a tuple . A column in the
Attribute
table is an attribute. Give each attribute a name, that is, the attribute name. A certain attribute group in the
main code (Key)
table can uniquely determine a tuple. The value range of the
Domain
attribute. An attribute value in the
component
tuple.
Relationship Mode
Description of the
relationship Relationship name (attribute 1, attribute 2, …, attribute n)
student (student number, name, age, gender, department, grade)

1.3_ The structure of the database system

1.3.2_ The three-level model structure of the database system

Insert picture description here
1. Mode (also called logical mode)
describes the global logical structure of data

The description of the logical structure and characteristics of all data in the database, a database has only one mode, the status of the mode : it is the middle layer of the database system mode structure

2. The outer mode (also called sub mode or user mode)
describes the local logical structure of the data

Status of external mode : between mode and application
①Relationship between mode and external mode: one-to-many
External mode is usually a subset
of mode. A database can have multiple external modes. Reflects the application needs of different users, the way of looking at data, and the requirements for data confidentiality.
For the same data in the model, the structure, type, length, and confidentiality level in the
external model can be different. ②The relationship between the external model and the application: one multi
same external mode may also be a user of the system used by multiple applications
, but an application can use an external mode
uses external mode
to ensure a robust database security measures of
each user can only see and access the corresponding Data in the outer model

3. Internal mode (also called storage mode)

It is a description of the physical structure and storage of data.
A database has only one internal mode.

1.3.3_ The secondary image function and data independence of the database

The three-level mode is the three abstract levels of data. The
second-level image realizes the connection and conversion of these three abstract levels within the DBMS.
External mode/mode mapping
mode/internal mode mapping

1. External mode/mode mapping
mode: describes the global logical structure of the data.
External mode: describes the local logical structure of the data.

Role :

Ensure the logical independence of the data.
When the mode changes , the database administrator modifies the related external mode/mode image to keep the external mode unchanged. The
application program is written according to the external mode of the data, so that the application program does not need to be modified and the data is guaranteed The logical independence of the program, referred to as the logical independence of the data.

2. Mode/Internal Mode Mapping
Mode/Internal Mode Mapping defines the correspondence between the global logical structure of the data and the storage structure .

Role :

Ensure the physical independence of data.
When the storage structure of the database is changed (for example, another storage structure is selected), the database administrator modifies the schema/internal schema mapping to keep the schema unchanged and the
application is not affected. Ensure the physical independence of data and programs, referred to as physical independence of data.

Guess you like

Origin blog.csdn.net/qq_43907296/article/details/110518486