Summary of database knowledge points

database

1. Basic Concepts

1. Data

(1) Definition of data: the symbolic representation of objective things, such as graphic symbols, numbers, letters, etc., data is the basic object stored in the database

(2) Types of data: text, graphics, images, sounds

(3) Characteristics of data: data and its semantics are inseparable

2. Database

(1) Definition of database: A database (DB for short) is a warehouse built on a computer storage device that organizes, stores and manages data according to the data structure.

(2) The basic structure of the database: the database composed of internal schema is called physical database; the data composed of conceptual schema is called conceptual database; the database composed of external schema is called user database.

  • physical data layer
           It is the innermost layer of the database and is the collection of data actually stored on the physical storage device. These data are raw data, which are objects processed by the user, and are composed of bit strings, characters and words processed by the instructions described in the internal mode.
  •  Concept database.
          It is the middle layer of the database and the overall logical representation of the database. It points out the logical definition of each data and the logical connection between the data, which is a collection of storage records. What it involves is the logical relationship of all objects in the database, rather than their physical situation, it is the database under the concept of the database administrator.
  • User database.
           It is a database that users see and use, representing a collection of data used by one or some specific users, that is, a collection of logical records.
    The connections between the different levels of the database are transformed through mapping.

3. Main features of the database

(1) Realize data sharing

(2) Reduce the redundancy of data

(3) Independence of data: logical independence, physical independence

(4) Centralized control of data

(5) Data consistency and maintainability

(6) Failure recovery

4. Database Classification

(1) Hierarchical database

(2) Network database

(3) Relational database

5. Database system

      Definition: A database system (DBS) is a system composed of a database and its management software.

6. Database management system (eg: MySql)

(1) Database Management System (DBMS for short) is a large-scale software for manipulating and managing databases, and is used to establish, use and maintain databases.

(2) The relational database management system is called RDBMS, and R refers to Relation.

(3) The role of DBMS: It manages and controls the database in a unified manner to ensure the security and integrity of the database.

7. Database Administrator

       Definition: The Database Administrator (DBA) is responsible for the overall management and control of the database system.

8. Relationship between DBA, DBMS, DB and DBS

      The DBA uses the DBMS to control the DBS composed of the DBs.

9. Data Model

      It is a tool for abstracting, representing and processing data and information in the real world, a simulation of the real world, and the core and foundation of a database system; its constituent elements include data structure, data manipulation and integrity constraints.

10. Conceptual Model

      Also known as an information model, it models data and information from the user's point of view, and is mainly used in database design.

11. Logical Models

       It is to model data from the point of view of computer system for DBMS implementation.

12. Physical model

       It is the lowest-level abstraction of data, describing the representation and access method of data in the system, the storage method and access method on disk or tape, and is oriented to computer systems.

13. Entities and Properties

       Things that exist objectively and can be distinguished from each other are called entities. A property that an entity has is called an attribute.

14.ER

        That is, entity-relationship diagram, which is used to describe things in the real world and their interrelationships, and is the main tool for the design of database conceptual model.

15. Relationship Patterns

        From the user's point of view, a relational schema consists of a set of relations, and the data structure of each relation is a normalized two-dimensional table.

16. Type/Value

        A type is a description of the structure and properties of a certain type of data; a value is a concrete assignment of a type, an instance of a type.

17. Secondary image of the database

         Outer mode/mode image, mode/inner mode image.

2. Database Management System (DBMS)

1. Main functions of DBMS

(1) Data definition function: provide data definition language (DDL)

          Used to define all features and properties of the database, especially row layout, column definitions, key columns (and sometimes key selection methods), file locations, and storage policies, including commands:

  • DROP (drop database)

    Delete database: drop database if exists database name

  • CREATE (create database)

    Create a table: create table if not exists table name (column name column name constraint)

  • ALTER (modify database)

    Add column name: alter table table name add column name constraint

    Modify column name: alter table table name change old column name new column name data type

    Modify column field data type: alter table table name modity column name data type

    Delete column name: alter table table name drop column name

    Modify table name: alter table table name rename new table name

  • GRANT (grant authority)

    REVOKE (revoke permissions from the current user or group), TRUNCATE (only delete all data in the table, do not delete the structure of the table)

 Among them: truncate table command will quickly delete all records in the data table, but keep the data table structure.

            The data deleted by the delete command will be stored in the system rollback segment. When necessary, the data can be rolled back and restored, while the data deleted by the truncate command is irrecoverable.

(2) Data manipulation function: provide data manipulation language (DML)

          Manipulate data to implement basic operations on the database:

  • SELECT (query)

    select from table name where condition (condition 1 and condition 2)

  •  INSERT (insert)

    insert into table name(column 1, column 2) values(' ',' '),(' ',' '),(' ',' ')

  • DELETE (delete)

    delete from table name where condition

  • UPDATE (modification)

    update table name set column name=' ', column name=' ' where condition

(3) Operation management of the database

  • Ensure data security and integrity
  • Concurrent use of data by multiple users
  • System recovery after a failure

(4) Database establishment and maintenance function (utility program)

  • Database data batch loading
  • database dump
  • Repair of media failure
  • Reorganization of the database
  • performance monitoring

2. Classification of DBMS

(1) Classification:

  • Large databases: Sybase, Oracle, db2
  • Medium database: mysql, sql server, infomix
  • Small databases: Access, foxbase, sqlite

(2) Features of Mysql, SQL server, Oracle, DB2:

  • Oracle:

    a. The most stable, most powerful, best performance, unlimited capacity, most expensive, heavyweight, distributed database system, suitable for large-scale projects

    b. "Relational----Object" database

  •  MySQL:

    a. Lightweight, easy to install, easy to manage, relatively fast, easy to use, suitable for small and medium-sized enterprises

    b. Open source, free, and a classic LAMP combination with PHP

  • SQL Server:

    a. Five special editions for different user groups

    b. Easy to use

  •   DB2:

    a. Applicable to large-scale application systems, with good scalability

3.B/S and C/S

(1) B/S browser server Browser Server

         Customers do not need to install programs, just have a browser engine: Taobao

(2) C/S client server Client Server

         Customers need to install programs, such as: QQ

 

    

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324633825&siteId=291194637