Database System Introduction

Database system components

  • database
  • Database management system (and its development tools)
  • operating system
  • Database Administrator
  • Hardware platforms and databases
  • software
  • personnel

Database System Overview

basic concepts

  • Database system (DBS) is a database, the database management system (and its application development tools), application and database administrator (DBA) consisting of storage, management, and maintenance of data processing systems

  • Database Management System (the DBMS) : Core Software

    • Features: data definitions; data organization, storage and management; data manipulation; transaction management and operational management of the database; the establishment and maintenance of the database; others
  • Database (DataBase): DB

    • Is a long-term storage in a computer, an organized collection of large amounts of data can be shared
  • Database Users

    • The first category of users: the end-user (End User)
    • The second class of users: Application Programmer (Application Programmer)
    • The third category of users: database administrator (DataBase Administrator): DBA

development process

image-20200221100337166

System Features

  • Database System Features:

    • Structured Data: Model Data minimum access unit: Field

    • High data sharing

    • High data independence: Logical Physical data

    • Unified data management and control by the DBMS

      • Data security protection
      • Data integrity check
      • Concurrency Control
      • Database Recovery

Data Model

basic concepts

  • In the database using this tool to model data abstraction, representation and processing of data and information in the real world

  • Category: conceptual model : for DBMS to achieve network model, hierarchical model, relational model, object-oriented model, object-relational model

    Logical and physical models : the bottom of the abstract data described in the data representation and access within the system

  • Constituent elements: a data structure; data operation; integrity constraints;

Conceptual Model

  • Basic concepts: the entity; attribute; code; field; entity type; entity set; Contact

    • Code: attribute set that uniquely identifies the entity
    • Domain: attribute range
    • Entity Type: Entity name and attribute name and describe the same set of abstract entities
    • Entity set: a collection of entities of the same type is called an entity set
    • This all hell
  • Links between the two entities type

  • Type contact between two or more entities

  • Contact within a single entity type

    Certain employees (cadres) "lead" a number of employees, a worker is only the direct leadership of another worker

Entity - Contact (ER method)

  • Entity type: rectangle, rectangle write the name of the entity
  • Properties: oval, with no connection to the edge
  • Contact: diamond, box indicate the contact name, with no connection to the edge, and mark the contact type (1: 1,1: n or m: n)

Hierarchical Model

  • The earliest tree appears only one to many-to-many or many-to-decompose
  • Integrity constraints:

    • No values ​​corresponding to the parent node can not be inserted child node value
    • If the value deleted the parent node, the child node corresponding values ​​are also deleted
    • Update operations, should update all appropriate records to ensure data consistency
  • Storage structure

    • Neighbor-joining: in a hierarchical tree preorder traversal order of sequentially recorded values of all adjacent memory

      image-20200311112623416

    • Links Law

      • Children - Brother Links Law: Each record set two types of pointers, pointing to the far left and the children of brothers recently
      • Hierarchy sequence linker method: the tree in pre-order traversal sequence for each record link value
  • Advantages: simple and clear data structure; high query efficiency, performance is better than the relational model, is not less than the mesh model; support provides good integrity;

  • Cons: many to many unnatural links; multiple pairs of insert and delete restrictions, writing complex applications; Queries child node must pass through parent node; structure tends to close the command level programming;

Network Model

  • No parent allows multiple nodes; a node can have multiple parents;

  • Hierarchical model is actually a special case of a mesh model

  • Integrity constraints

    • Code: collection of data items that uniquely identifies the record;
    • Contact is a link between the many parents with their children recorded record;
    • Support some constraints between parents and children recorded record
  • To name for each contact, and pointed out that parents and children records associated with the contact record

  • Advantages: more directly describe the real world; good performance, high access efficiency;

  • Disadvantages: more complex structure, and with the expansion of application environments, more complex database structure is not conducive to end-users to master; DDL, DML language complex, which are not easy to use;

Relational Model

  • User point of view, the logical structure data in the relational model is a two-dimensional tables of rows and columns, transparent to the user access path

  • Contact between the entities and entities with a table to represent the table stored as files

  • Relationship: a table; tuple: line; properties: a;

    Main Code: an attribute group can uniquely identify a tuple;

    Domain: attribute range;

    Component: a tuple attribute value;

    Relational schema: one to one, one to many, many to many;

    image-20200311202734625

  • As well as the relationship does not allow table table(Prohibition of nesting dolls)

  • Integrity constraints: entity integrity; referential integrity; user-defined integrity;

  • Pros: based on strict mathematical basis of the concept; single concept; the access path of the relational model is transparent to users;

  • Disadvantages: Queries less efficient than non-relational data model; DBMS increase the difficulty of development;

Database System Architecture

basic concepts

  • Type: data structure and attribute of a class of instructions;

    Found: is a particular type of assignment;

  • Mode: data management, a type described

    Example: data

  • From the database management system to see: three model structure

  • From the database end users see: single-user configuration; master-slave configuration; distributed structure; client / server; browser / application server / database server multilayer structure

Three-mode architecture

  • A database is only a pattern within a pattern and can have multiple modes outer
  • Mode (Logical Mode): description of all the data in a database logical structure and characteristics ; intermediate layer structure database system mode;
  • External mode (user mode or sub-mode): strong measures to ensure the security of a database; each user can only see and access the external data corresponding to the pattern;
  • The mode (storage mode): description of the physical structure and data storage; representing data within the database;

Two mapping function and data independence

  • Two image patterns to achieve three links and internal conversion DBMS

  • External mode / image mode: logic to ensure data independence

    • Each outer mold has a corresponding relation between the outer mode / image mode, the external mode and the mode is defined
    • Defined in the respective image typically contains described external mode in
  • Mode / the mode map: guarantee the physical data independence

    • It defines the correspondence relationship between the logical structure and the global data storage structure
    • The image is usually included in the definition of mode described in

Guess you like

Origin www.cnblogs.com/localhost-ha/p/12465821.html