《 Principle and application of database 》 Review summary


Database technology is mainly about how to organize and store data scientifically , Efficient data acquisition and processing , And can meet the various information needs of users , Because the demand for database technology is very large , So it is very necessary to learn the knowledge and technology of this course , It should be understood skillfully , Master the data , data management , database , The connotation of professional terms such as data model and conceptual model .

The first 1 chapter introduction

1. Master database , Database management system , database system ( form ) The concept of

2. Understand the three stages of database technology development

3. Master the concept of three-level mode and secondary image

4. Understand the main functions of database management system

Knowledge points :

data : The object of database system research and processing , A symbolic record of things in the world , There are four characteristics :

1: The data are “ value ” and “ type " The division of

” value “ It refers to the specific value of the data ,” type “ It refers to the structure of the data .

2: Data is constrained by value range and type .

3: There are qualitative expression and quantitative expression .

4: It has carrier and various forms of expression .

database : Long term storage in computer , organized , Shareable , Data collection under unified management , It is a computer software system that stores data according to data structure .

1: Data warehouse , New methods and technologies of data management , Better organization of data , More convenient and reasonable maintenance , control , Using data .

The characteristics of a set of data :

1: Minimum redundancy .

2: Application sharing of data resources .

3: High data independence .

4: Unified management and control .

Database management system (DBMS): Software that provides data management between the user and the computer operating system .

Unified management and control of database , To ensure the security and integrity of the database , Users can use the DBMS Accessing the contents of the database , Database administrators can use the DBMS Maintenance data .

major function :

1: Data definition capability : Language defined by database (DLL), Implement definition function .

2: Data manipulation capability :DBMS Provide data manipulation language <http://baike.baidu.com/view/3426309.htm>DML(Data
Manipulation Language), For users to add data , delete , to update , Query and other operations .

3: Organization of database <http://baike.baidu.com/view/46944.htm>, Storage and management :DBMS To organize by category , storage
<http://baike.baidu.com/view/87682.htm> And manage all kinds of data , Including data dictionary
<http://baike.baidu.com/view/70173.htm>, user data , Access path, etc .

4: Establishment and maintenance of database : Database recovery , Concurrency control of database <http://baike.baidu.com/view/1672732.htm>, Database
Integrity control <http://baike.baidu.com/view/3253924.htm>, Database security control , Data loading of database , transformation , dump , database
<http://baike.baidu.com/view/1088.htm> Reconfiguration, performance monitoring and other functions ,

database system :

Including computer hardware , database , Database management system , Application system and database administrator , A computer system with database and database technology for database management .

Compared with file system, database system has the following characteristics :

1: Data structure .

2: The data redundancy of database system is small , High degree of data sharing .

3: There is a high independence between data and program in database system .

4: The smallest access unit of data in database is data item .

5: Unified data management and control .

6: Provide database protection .

The first 2 chapter Data modeling

1. Master entity connection model (E-R chart ) Representation of , Include entities , attribute , Contact and contact type .

2. Understanding the three elements of data model

3. Understanding levels , Characteristics of mesh data model

Knowledge points :

Common database models :1, hierarchical model :

2, Mesh model ,3, relational model ,4 Object oriented model .

 1. entity (Entity)

   An entity is an objective existence in the real world . It can be a concrete thing , Like a house , One element , One person, etc , It can also be abstract , Like an idea , A plan , Or a project, etc . Entities are characterized by their own attribute values . Entity is divided into strong entity and weak entity .

 2. Entity set :
   The set of entities with the same structure and characteristics is called entity set . for example , Student entity set , Class entity set, etc .

3. Entity type :
   Describes the information structure of entity set , Typically includes a collection of type names and entity property names . for example , student ( Student number , full name , Gender , Age , class ).
  4. attribute :
   Describe the characteristics of an entity or connection . Each property of an entity is called an attribute . Property has property name , Property type , The distinction between attribute definition domain and attribute value .
  5. Entity identification ( Code or key ):
   The attribute set whose value can uniquely identify each entity is called the entity ID . In a relational database, the identity of an entity is called a code or key , Its identification code is the value of a single attribute or subset of attributes of an entity .
   for example , Student number , It is not only the attribute of students, but also the identification code of students , The identification of the Institute can be the name or number of the Institute .
  6. contact :

   In the real world , The relationship between things is objective , Connection reflects the relationship between entities . This connection must be described in the information world . and , In addition to being used as an attribute , The connection itself can also have attribute values .
   for example , Each teacher belongs to a research institute , There is a subordinate relationship between each teacher and a research institute to which he belongs . 
  7. Contact set :
   The same type of connection between entities also forms the connection set . for example , A set of affiliations is formed between teachers and their research institutes .
  8. Contact type :
   Describes the information structure of connection sets between entities with common characteristics , Usually includes the type name of the connection , Attribute of connection, etc .

   for example , Between each teacher and a research institute to which he belongs " belong to " contact ; Between each teacher and the students he teaches " Teaching and learning " The connection of ; Between the parts suppliers and the parts they supply " supply " contact ," supply " The attributes of connection include supply quantity, etc .

 

 


· data (Data):

Facts reflecting the objective world , And can distinguish the characteristics of the symbol : character , number , text , voice , graphical , image , Chart , Pictures, etc , They exist objectively in the real world , Can be input into the computer for storage and management .
· information (Information):
Processed and refined from raw data , Used to determine behavior , Plan or data with certain semantics is called information .
· database DB(Data Base):
It is the collection of a large number of interrelated data and data relations in the real world .
· Database management system DBMS(Data Base Management System):
It is a software system to store and manage the data in the database . Including storage , Administration , Various languages and tools for retrieving and controlling data in databases , It's a set of system software . 
· database system DBS(Data Base System):
Is the general name of database and database management system . It refers to the collection of interrelated data and software tools for manipulating data .DBS = DB+DBMS
· Database application program interface API(Application Programming Interface):
By DBMS The interface function of manipulating and accessing data in database provided for developing application program , Process or language .
· Database application AP(Application Program):
A program for manipulating and accessing a database that meets the requirements of a certain class of users .
· data warehouse (Data Warehouse)
A data warehouse is a business application system with its own database . Using existing data resources , Transforming data into information , Dig out knowledge from it , Refine into wisdom , Create benefits . 
· Data mining (Data Mining)
Data mining can help business users deal with large amounts of existing data , In order to discover some " Unexpected relationship ", In order to increase market share and profit .
· Information mining (Information Mining):
Information mining refers to document mining , Map , Photo , Sound and image: finding relevant information in the vast ocean , That is, content-oriented retrieval .
· Data mode (Data Model):
In the database , On the data ( entity ) A description of is called a database schema . It is described by the corresponding schema definition language .
· data model (Data Model):
It is the digital simulation and abstraction of real world characteristics .
· field ( Field):
The smallest unit of data in hierarchical data model , Describes the properties of an entity .
· fragment (Segment):
yes IMS The unit that describes an entity in a hierarchical data model , A record consisting of a collection of fields . It is also the unit where applications access database data .
· data item (Data Item):
yes DBTG The smallest unit of data in a named mesh data model , Represents an attribute of an entity .
· record (Record ):
yes DBTG A unit that describes entities in a named mesh data model , Is an ordered collection of data items .

· field (Domain):
A field is a collection of values , That is, the value range of the value .
· relationship (Relation):
A relationship is a two-dimensional table , Each table has a table name .
· tuple (Tuple):
A row in a relational table is called a tuple . Tuples can represent an entity or a relationship between entities .
· attribute ( Attribute):
A column in a relational table is called a relationship An attribute of , A data item of a tuple . Property has property name , Property type , The difference between attribute value domain and attribute value . Property names are unique in the table .

 

· keyword ( Primary Key ):
A property or combination of attributes in a table , Its value can uniquely identify a tuple in a relationship . Keyword property cannot take null value .
· External keywords (Forgien Key):
The attribute group corresponding to the keyword of another relationship contained in one relationship is called the external key of the relationship . The external key is null or the corresponding key value in the external table .
· Network Library (Net-Library):
A communication software package , Package database requests and results , Transmitted by network protocol . Also known as Net-Library, Install on both client and server .
The first 3 chapter relational database

 

2. Understanding relational 6 Nature

3. Grasp the concept : code , Primary attribute and non primary attribute , Full code and external code , Representation of relational schema .

4. Three kinds of integrity constraints of master relation ( Entity integrity , Referential integrity and user-defined integrity )

5. Skillfully use relational algebra to express all kinds of queries ( Set operation , choice , Projection , connect , except ) ; According to the data table structure , Using relational algebra to express query requirements .

Knowledge points :

Six characteristics of relationship :

(1) The data of the same attribute has homogeneity .

(2) Attribute names of the same relationship are not repeatable .

(3) Column positions in relationships can be swapped .

(4) Tuples in the same relationship cannot be exactly the same .

(5) Tuple order can be exchanged .

(6) Each component must be an indivisible data item .

The code of relation :

Candidate code : A property or set of attributes that uniquely identifies a tuple in a relationship .

such as :“ Student relations ” The middle school number can uniquely identify each student . If there are multiple candidate codes , You can choose one as the main code ,

Primary attribute : Any attribute contained in the candidate code is called the primary attribute .

Non primary attribute : Attributes not included in any candidate code , such as : In student relations “ Student number ”, Classroom relations “ Classroom number ”.

Data conceptual model :

E-R chart :

For example :

  UML Model :                           

There are usually four :

1: hierarchical model .

2: Mesh model .

3: relational model .

4: Object oriented model .

Formal representation of relational schema :

R(U,D,DOM,F);

R: Relation name .

U: The domain from which the attributes that make up the relationship come from .

DOM: Property to the domain .

F: The collection of data dependencies between attributes .

Entity integrity rules :

attribute A It's the basic relationship R The primary attribute of the , Then attribute A The value of cannot be null .

Referential integrity ;(F Each property of is null , Or equal to the main code value of a tuple ). For example :



User defined integrity .

Operators of relational algebra :



 

The first 4 chapter Normalization theory

1. Grasp the concept : Functional dependency , Partial functional dependence , Complete functional dependence and transfer function dependence .

4. Master the concept of paradigm :1NF,2NF,3NF

5. Master the decomposition method and steps of pattern ; Can be based on a given relational schema , Judge the type of its normal form , And decompose according to the requirements , Achieve the required paradigm level .

 6. Understanding the principles of relational schema decomposition

Knowledge points :

Basic requirements of relational model :

(1) Each component of a tuple must be an indivisible data item .

(2) Data redundancy in the database should be minimized .

(3) When updating data , No update exception will be generated .

(4) Insert , No insert exception will be generated .

(5) Delete , No delete exception will be generated .

The main package of normalization theory in relational database 含三个方面的内容:

1,函数依赖,2,范式,3,模式设计.

在数据的规范化理论中,模式分解应满足的几个条件是:遵守规范化理论,保持原有的依赖关系,无损连接性.

1NF:消除非主属性对键的部分函数依赖关系,变为2NF.

2NF:  消除非主属性对键的传递函数依赖关系,变为3NF.

3NF:消除主属性对键的部分函数,和传递函数依赖关系,变为BCNF.

在规范化的过程中,逐渐消除了存储异常,使数据冗余度尽量小,便于插入,删除,更新.

第5章 数据库设计

1.理解数据库设计的6个步骤及采用的方法

3.掌握概念结构(E-R图)设计方法,理解各分E-R图之间常见的三类冲突

4.掌握E-R图向关系模式转换的规则,了解数据模型的优化

能够根据给定的语义,找出相关实体,实体的属性,实体间联系,画出E-R图,并能转换为相应的关系模式.

知识点:

数据库设计的任务,内容,特点:

(1)广义的数据库设计,是指建立数据库及其应用系统,包括选择合适的计算机平台和数据库管理系统,设计数据库,以及开发数据库应用系统等.

(2)狭义的数据库设计,是指
根据一个组织的信息需求,处理需求和相应的数据库支撑环境(主要是数据库管理系统DBMS),设计出数据库,包括概念结构,逻辑结构和物理结构.其成果主要是数据库.

(3)数据库设计有两种不同的方法:一种是以信息需求为主,兼顾处理需求,称为面向数据的设计方法,一种是处理需求为主,兼顾信息需求,称为面向过程的设计方法.

优缺点:第一种:可以比较好的反映数据的内存数据,既可以满足当前应用需求,也可以满足潜在需求.

                第二种:初始阶段可能比较满足,但随着应用的发展和变化,需要进行很大的改动,设计,以满足实际需求.

                在实际应用中,对于用户的数据是变动的,所以一般采用面向数据的设计方法.

数据库设计的成果:(1)数据库模式;(2)数据库为基础的典型应用程序,最基本的成果是数据库模式.

数据库设计的特点:

同其他工程一样,数据库也有自己的特点,主要表现在以下四个方面:

(1)复杂性.(2)反复性,(3)试探性,(4)分布进行.

数据库设计方法:

数据库方法学的指导原则:

1:可以在短时间内,合理的工作量,产生有实用价值的数据库结构.

2:具有足够的灵活性和通用性,可以供具有不同经验的人使用,使用与于不同数据模型的DBMS限制.

规范化的设计方法:新奥尔良法,它将常见的数据库设计分为四个阶段:需求分析,概念分析,逻辑分析,物理分析.

基于E-R模型的数据库设计方法,基于3NF的设计方法.

数据库设计的步骤:

1:需求分析:

 


需求分析阶段,主要是准确收集用户信息需求和处理需求,并对收集的结果进行整理和分析,形成需求说明.需求分析是整个设计活动的基础,也是最困难和最耗时的一步.如果需求分析不准确或不充分,可能导致整个数据库设计的返工.

2:概念设计:

 


概念结构设计是数据库设计的重点,对用户需求进行综合,归纳,抽象,形成一个概念模型(一般为ER模型),形成的概念模型是与具体的DBMS无关的模型,是对现实世界的可视化描述,属于信息世界,是逻辑结构设计的基础.

3:逻辑结构设计阶段:

 

逻辑结构设计是将概念结构设计的概念模型转化为某个特定的DBMS所支持的数据模型,建立数据库逻辑模式,并对其进行优化,同时为各种用户和应用设计外模式.

4:物理设计:

 

物理结构设计是为设计好的逻辑模型选择物理结构,包括存储结构和存取方法,建立数据库物理模式(内模式).

5: 实施和维护阶段:

 


实施阶段就是使用DLL语言建立数据库模式,将实际数据载入数据库,建立真正的数据库;在数据库上建立应用系统,并经过测试,试运行后正式投入使用.维护阶段是对运行中的数据库进行评价,调整和修改.


 



需求分析工具:

1:数据流图和数据字典.

2:UML统一建模语言:用例,静态,行为,实现图.

概念设计方法,步骤:

(1)自顶向下.

(2)自底向上.

(3)逐步扩张.

(4)混合策略.

E-R图设计方法:

是一种广泛采用的概念模型设计方法.表示方法如下:

1,实体.

2,属性.

3,联系.

UML设计方法:

UML类图与E-R图的区别:



逻辑结构步骤:

1.将概念模型结构转化为一般的关系,网状,层次模型.

2.将转化来的关系,网状,层次模型向特定的DBMS支持下的数据模型转化.

3.对数据模型继续优化.

第6章 SQL语言

1.数据定义语言,数据查询语言,数据更新语言

2. 索引,视图的概念

能够根据给出的表结构和查询要求,写出相应的SQL 语句

 第7章 数据库安全保护(非重点章节)

1.掌握概念:事务,事务的特征

2.理解安全性控制的概念及常用的方法,掌握权限授予与回收的基本语句,

3.理解完整性控制的概念

4.理解并发控制的概念,并发所导致的三类数据的不一致性,具体参见:

理解封锁的概念,了解封锁协议

 5.了解数据库恢复的概念及原理