Basic concepts of database
I.
Database related concepts: data, database, database management system, database system
II.
Data: basic objects stored in the database. Data definition: symbolic records that describe things are called data.
Database: a warehouse where data is stored. Database has three basic characteristics: ① permanent storage, ② organized, ③ can be shared.
Database management system: the system software that can efficiently obtain and maintain data storage is: database management system. Database management system is a data management software located between the user and the operating system. Main functions: ① data definition function: provide data definition language (DLL:Data Definition Language); ② data organization, storage and management: data organization and storage goal: improve storage space utilization and facilitate access, provide a variety of access methods: index search, Hash search, sequential search and so on. ③ data manipulation function: data manipulation language (DML:Data Manipulation Language) can use DML to manipulate data to query, insert, delete and modify data. Transaction management and operation management of ④ database: unified management, unified control, ensuring data security, integrity, multi-user concurrent use of data, system recovery after failure. ⑤ database establishment and maintenance: including: database initial data input, conversion function, database rollover and recovery, database reorganization function and performance knowledge, analysis function. Other functions of ⑥: the communication function between DBMS and other software systems in the network; the data conversion function between a DBMS and other DBMS or file systems; the mutual access and interoperation between heterogeneous data.
Database system (DataBase System,DBS): it is generally composed of database, database management system, application system and database administrator. Database administrator: DBA (DataBase Administrator)
3.
There are three stages of database: manual management stage, file system stage and database system stage.
Characteristics of manual phase: data is not saved, applications manage data, data is not shared, and data is not independent.
File system stage: data can be maintained for a long time and managed by the file system; disadvantages: poor data sharing, large redundancy, poor data independence
Database system stage: there is a special software system for unified management of data-database management system.
IV.
The characteristics of database system: 1. Data structure; 2. High data sharing, low redundancy, easy to expand; 3. High data independence; 4. The data is uniformly managed and controlled by DBMS.
DBMS provides four data control functions: 1. Data security protection; 2. Data integrity check; 3. Concurrency control; 4. Database recovery.
5.
Data models are divided into two categories: one is conceptual model, the other is logical model and physical model.
The data model needs to meet three conditions: first, simulate the real world more truly; second, it is easy to be understood by people; third, it is easy to be realized on the computer.
Conceptual model: also known as information model. Modeling data and information from the user's point of view, mainly for database design.
Logical model: mainly includes: hierarchical model, mesh model, relational model, object-oriented model, object-relational model; mainly used for the implementation of DBMS.
Physical model: the abstraction of the lowest level of data, describing the representation and access of data within the system.
VI.
The data model usually consists of three parts: data structure, data operation and integrity constraint.
Data structure: the data structure describes the relationship between the constituent objects of the database and the objects. The content of data structure description can be divided into two types: one is related to the type, content and nature of objects, and the other is related to the relationship between data. A data structure is a collection of described object types and a description of the static characteristics of the system.
Data manipulation: a collection of operations allowed to be performed on instances of various objects in a database. It is a description of the dynamic characteristics of the system.
Data integrity constraints: ensure that the data is correct, effective and compatible.
7.
Conceptual model: the first layer of abstraction from the real world to the information world.
Basic concepts in the information world: entity, attribute, code, domain, entity type, entity set, relation.
The relationship between two entities: one, one-to-one connection; two, one-to-many connection; third, many-to-many relationship (entity-contact map Emurr diagram. The entity is rectangular, the attribute is elliptical, and the connection is diamond)
The most commonly used logical models: hierarchical model, mesh model, relational model, object-oriented model, object-relational model.
8.
Schema is the description of the logical structure and characteristics of all the data in the database. A specific value of a pattern is called an instance of the pattern. The model is relatively stable and the examples are relatively changeable.
The database system is divided into three levels of schema structure: external schema, internal schema.
Pattern: logical pattern, specific table structure. There's only one.
External mode: submode, view. There are multiple.
Internal mode: storage mode, which is a description of the physical structure and storage mode of data.
There are two layers of images between three-level models: external mode / pattern, pattern / inner pattern.