当前位置:网站首页>Introduction to database system - Chapter 1 introduction [conceptual model, hierarchical model and three-level mode (external mode, mode, internal mode)]

Introduction to database system - Chapter 1 introduction [conceptual model, hierarchical model and three-level mode (external mode, mode, internal mode)]

2022-07-07 13:38:00 kokotao

1, Data system overview

Four basic concepts of database :

data 、 database 、 Database management system 、 Database system ;

  • 1 data : The symbolic record that describes things is called data
  • 2 Database is stored in computer for a long time 、 Organized 、 A collection of large amounts of data that can be shared .
  • 3 Database management system is to solve how to efficiently acquire and maintain data 、 How to organize and store data scientifically
  • 4 The database system is controlled by the database 、 data management system ( And its application development tools )、 Storage composed of application and database administrators 、 management 、 A system that processes and maintains data .

The emergence and development of data management technology

 course

  • 1 Manual management stage ,2 File system phase ,3 Data system phase

Characteristics of database system

  • 1 Data structure : The database system realizes the structure of the whole data , This is one of the main features of the database , It is also the essential difference between database system and file system .
    ( The whole refers to that the data in the database is no longer only for a certain application , But for the whole organization or enterprise ); It is not only internally structured but also integrally structured , There is a connection between data .
    2 High data sharing 、 Low redundancy and easy expansion ;
    ( Data sharing can also avoid incompatibility and inconsistency between data .)
    3 High data independence :
    ① Physical independence means that the physical storage of data in user applications and databases is independent of each other .
    ② Logical independence means that the logical structure of the user's application and data are independent of each other .
    4 The data is uniformly managed and controlled by the data management system ;
    (1) Data security protection ;
    (2) Data integrity check ;
    (3) concurrency control ;
    (4) Data recovery ;
  • summary : The database is organized and stored in the computer for a long time 、 A lot of 、 Shared data collection . It can be shared by various users , It has minimum redundancy and high data independence . The database management system is established in the database 、 The database shall be under unified control during operation and maintenance , To ensure data integrity and security , And use the database for concurrency control in multiple users at the same time , Recover the database after failure .

2 Data model : Data model is an abstraction of the characteristics of real-world data , Data model is the core and foundation of database system .

Two types of data models ;

  • The first kind of conceptual model

    • Also known as the information model , Modeling data and information according to users' ideas is mainly used in database design .
  • The second is the logical model and the physical model

conceptual model

  • 1 The basic concepts in the information world :
    ① Entity : Things that exist objectively and can be distinguished from each other
    ② attribute : An entity has a property called an attribute
    ③ code (key): The set of attributes that uniquely identify the entity
    ④: Solid type : Using entity name and its attribute name set to abstract and characterize similar entities , It's called the solid body ;
    ⑤ Entity set : A set of entities of the same type is called an entity set .
    ⑥ contact : The relationship between entities usually refers to the relationship between different sets of entities
  • Entity - How to contact (E—R Model )

The components of the data model : Data model is usually composed of data structure 、 Data operation and data integrity constraints are three parts .

  • data structure : Describe the objects that make up the database and the relationships between them .
    Data manipulation : It refers to the collection of operations allowed for instances of various objects in the database , Including operation and relevant operation rules .
    Data integrity constraints : Data integrity constraints are a set of integrity rules

Common data models

  • hierarchical model

    • 1 There is only one node without parents , This node is called the root node ;
      2 Nodes other than the root have only one parent node .
      The hierarchical model is like an inverted tree , Node parents are unique .
       hierarchical model
  • Mesh model

    • Data structure of mesh model :
      (1) Allow more than one node to have no parents .
      (2) A node can have more than one parent .
    •  Mesh model
  • relational model : The data structure of each relationship is a normalized two-dimensional table

    • Some terms of relational model :
      ① Relationship (relation): Represents a table corresponding to the usual ;
      ② Tuples (tuple): A row in the table is a tuple ;
      ③ attribute (attribute): A column in the table is an attribute ;
      ④ code (key): Also called code key .
      ⑤ Domain (domain): A field is a set of values of the same data type ;
      ⑥ component : An attribute value in a tuple .
      ⑦ Relationship model : Description of the relational model , It is generally expressed as :
      Relationship name ( attribute 1, attribute 2,···, attribute n)
    • The relationship model requires that the relationship must be normalized , Each component of a relationship must be an indivisible data item ( There are no more tables in the table )
    • The advantages and disadvantages of the relational model :
      One advantage :① The relational model domain format model is different , It is based on strict mathematical concepts ;
      ② Single concept of relationship model ;
      ③ Access path of relational model is transparent to users , So it has higher data independence 、 Better security , It also simplifies the work of programmers and database development ;
  • Object oriented data model

  • Object relational data model

  • Semi structured data model

3 The structure of the database system

Database system schema concept

  • There is... In the data model ” type “ and “ value ” The concept of .
  • The pattern is relatively stable , And the examples are relatively variable ;

Three level pattern structure of database system

 Insert picture description here

  • 1, Pattern (schema): Patterns are also called logical patterns , It is a description of the logical structure and characteristics of all data in the database , Is a common data view for all users .
  • 2 External mode (external schema): Also known as sub mode or user mode , It is the logical structure and feature description of local data that database users can see and use , It's the database user's data view , Is a logical representation of data related to an application .
  • 3 Internal mode (internal schema): Internal mode is also called storage mode (storage schema), A database has only one internal schema . It is a description of the physical structure and storage of data , It's how the data is organized inside the database .

Database secondary image function and data independence ( One sentence summary : Adjacent levels have an image )

  • The database management system provides two layers of images between the three-level modes : External mode / Mode image and mode / Internal mode image . Ensure that the data in the database system can have high logical independence and physical independence .

  • 1 External mode / Pattern image ——> Logical independence

    • Modified the table structure ( It's a conceptual model ) You only need to modify the image between the external schema and the conceptual schema ( Change the external mode , Such as the definition of view ), Without modifying the user program .
  • 2 Pattern / Internal mode image ——> Physical independence

    • Modified the physical storage method of data ( For example, add a secret ), Table structure ( It's a conceptual model ) Can remain the same .

Composition of data system

  • 1 Hardware platform and database
    2 Software
    3 personnel

summary

The conceptual model is briefly introduced 、 The three elements and three main data models that make up the data model ( hierarchical model 、 Mesh model 、 relational model ), The relationship model will be introduced in detail later .

原网站

版权声明
本文为[kokotao]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071136569627.html