What the database implements is the true structure of data.
The data structure is described by the data model, without the need for program definition and interpretation.
Data can become longer
The minimum unit of data access is data items.
The database system looks at and describes data as a whole. Data is oriented to the entire system and can be shared and used by multiple users and applications.
Benefits of data sharing
Reduces data redundancy and saves storage space
Avoid data inconsistency and inconsistency
Easy System Expansion
Physical independence
Data in your applications and databases stored on disks is independent of each other. When the physical storage of data changes, applications do not need to change.
Logical independence
The logical structure (logical mode) of your applications and databases is independent of each other. The logic structure of the data has changed, and the user program can remain unchanged.
Data independence is guaranteed by the DBMS's second-level image function.
Data ModelAbstract: extract common and essential features from numerous things, and discard non-essential features. For example, apple, bananas, raw pears, peaches, and so on. They share the same characteristics as fruits. The process of getting the concept of fruit is an abstract process. To be abstract, you must compare them. If there is no comparison, you cannot find a common part. Common features are the features that distinguish a class of things from other things. These differentiated features are also called essential features. Therefore, the common feature of extracting things is to extract essential features of things and discard non-essential features.
There are two types of data models (two different layers)
(1) the conceptual model, also known as the information model, is used to model data and information from the user's point of view for database design.
(2) logical and physical models
Logical models mainly include mesh models, hierarchical models, relational models, and object-oriented models. Data is modeled based on computer systems and used for DBMS implementation.
The physical model is the abstraction of the bottom layer of data. It describes the representation and access methods of data in the system, and the storage and access methods on disks or tapes.
Data StructureWhat is data structure?
Describes the database composition objects and the relationships between objects.
Description
Objects related to the data type, content, and nature
Objects related to data connections
The data structure describes the static features of the system.
Data OperationsData Operations
Instances (values) of various objects (types) in the database that can be executed
Operations and related operation rules
Data Operation Type
Query
Update (including insert, delete, and modify)
Data Model Definition of operations
EXACT MEANING OF THE OPERATION
Operation symbol
Operation Rules (such as priority)
Operating Language
Data operations are a description of the dynamic features of the system.
Constraints on Data IntegrityConstraints on Data Integrity
A set of integrity rules.
Integrity rules: Constraints and dependency rules for data and their links in a given data model
It is used to limit the database status and status changes that conform to the data model, so as to ensure that the data is correct, valid, and compatible.
Definition of integrity constraints in Data Models
Reflects and specifies the basic general integrity constraints that this data model must comply. For example, in a relational model, any link must meet two conditions: entity integrity and reference integrity.
Provides a mechanism for defining integrity constraints to reflect the specific semantic constraints that must be observed for data involved in a specific application.
Conceptual ModelUsage of the Conceptual Model
Conceptual Model Used for modeling the information world
It is an intermediate layer from the real world to the machine world.
It is a powerful tool for database design.
Language of communication between database designers and users
Basic Requirements for Conceptual Models
Strong semantic expression capability
Can easily and directly express various semantic knowledge in applications
Simple, clear, and easy to understand
Basic concepts in the information world(1) The Entity exists objectively and can be differentiated from each other. It can be a specific person, thing, thing, or abstract concept. (2) An Attribute is a property. An object can be characterized by several attributes. (3) The property set that uniquely identifies an object is called a code. (4) The value range of the Domain attribute is the Domain of this attribute. (5) Entity Type abstracts and depicts similar entities using Entity names and their attribute names. (6) A Set of entities of the same type is called a Relationship) in the real world, the connections between things inside and between things are reflected in the information world as those between entities. The internal link of an object usually refers to the link between attributes of an object. The link between entities usually refers to the link between different object sets.
Common Data ModelsNon-Relational Model
Hierarchical Model)
Network Model)
Relational Model)
Object Oriented Model)
Object Relational Model)
Hierarchical ModelHierarchical Model is the earliest data model in the database system.
A typical example of a hierarchical database System is the ibm ims (Information Management System) database Management System.
The hierarchical model uses a tree structure to represent the relationships between various entities and entities.
Hierarchical Model
The set of basic hierarchical links that meet the following two conditions is a hierarchical model.
1. There is only one node with no parent node. This node is called the root node.
2. Other nodes except the root node have only one parent node.
Several terms in the layered model
Root Node, parent node, sibling node, leaf node
Hierarchical Model features:
The parent node is unique.
Only one-to-many physical connections can be processed directly.
Each record type can define a sorting field, also known as the codeword segment.
Any record value can display all its meaning only when it is viewed by its path.
No child record value exists independently from the parent record value
Advantages
The data structure of the layered model is simple and clear.
High query efficiency, better performance than the relational model, not lower than the mesh model
The hierarchical data model provides excellent integrity support.
Disadvantages
Multi-to-Multi-contact is not natural
There are many restrictions on insert and delete operations, and the compilation of applications is complicated.
The child node must be queried through the parent node
Hierarchical commands tend to be procedural due to strict structure
Mesh ModelThe mesh database system uses the mesh model as the Data Organization Mode
A typical example is the DBTG system:
Also known as CODASYL System
A system solution proposed by DBTG in 1970s
It laid the foundation for the basic concepts, methods, and technologies of the database system.
Actual System
Cullinet Software Inc. Company IDMS
Univac DMS1100
IDS/2 of Honeywell
HP IMAGE
Mesh Model
A set of basic hierarchical connections that meet the following two conditions:
1. allow more than one node to have no parent;
2. A node can have more than one parent.
Representation Method (same as the Hierarchical Data Model)
Solid type: description using record type
Each node represents a record type (entity)
Attribute: Field description
Each record type can contain several fields
Link: indicates the record type (entity) by connecting nodes.
One-to-multiple parent-child relationship
Data Structure of the mesh Data ModelDifferences between a mesh model and a hierarchical model
The mesh model allows multiple nodes without parent nodes
The mesh model allows nodes to have multiple parent nodes
The mesh model allows multiple connections (composite connections) between two nodes)
Mesh models can more directly describe the real world
The layered model is actually a special case of the mesh model.
LINK modelThe relational database system uses the relational model as the data organization mode.
E. F. Codd, a researcher at the San Jose Research Center at IBM in 1970, first proposed a relational model for the database system.
Almost all new database management systems launched by computer vendors support relational models.
Data Structure of the relational modelRelationship)
A link corresponds to a table.
Tuple)
A row in the table is a tuples.
Attribute)
A column in the table is an attribute, and each attribute is named
Master code (Key)
An Attribute Group in a table that uniquely identifies a tuples.
Domain)
Attribute value range.
Component
A property value in the tuples.
Link Mode
Description of the link
Link name (attribute 1, attribute 2 ,..., Attribute n)
Student (student ID, name, age, gender, department, grade)
Advantages
Based on strict mathematical concepts
Single Concept
Entities and various types of connections are expressed in relationships.
The data retrieval result is also a link.
The access path of the relational model is transparent to users.
Higher Data independence, better security and confidentiality
Simplifies the work of programmers and the establishment of database development.