Database-Introduction to Databases

Source: Internet
Author: User
Tags ming

Database status

Database technology was generated in the late 60, is the latest technology of data management, is an important branch of computer science.
Database technology is the core and foundation of information system, its appearance has greatly promoted the infiltration of computer application to all walks of life.
The scale of database construction, the size of database information and the frequency of use have become the important sign of measuring the informatization degree of a country.

Data
数据(Data)是数据库中存储的基本对象数据的定义描述事物的符号记录数据的种类文本、图形、图像、音频、视频、学生的档案记录、货物的运输情况等数据的特点数据与其语义是不可分的

The meaning of the data is called the semantics of the data, and the data is not divided with its semantics.
For example 93 is a data
Semantic 1: A student's score in a course
Semantics 2: Someone's weight
Semantics 3: Number of students in computer science level 2003
Student records in student files
(Li Ming, Male, 197205, Jiangsu Nanjing, Computer Department, 1990)
Semantics: Student name, gender, date of birth, birthplace, faculty,
Admission Time
Explanation: Li Ming is a university student, born in May 1972, Jiangsu Nanjing People, in 1990, entered the computer department

Database
数据库的定义数据库(Database,简称DB)是长期储存在计算机内、有组织的、可共享的大量数据的集合。数据库的基本特征数据按一定的数据模型组织、描述和储存可为各种用户共享冗余度较小数据独立性较高易扩展
Database management System

What is a DBMS, Database Management System
A layer of data management software located between the user and the operating system.
is the basic software, is a large and complex software system
Commercial products: Oracle, SQL Server, DB2, Sybase, Informix
Open Source Product: Mysql,berkeley DB
Use of the DBMS
Organize and store data scientifically and efficiently to obtain and maintain data.
Data definition Features
Provide data definition language (DDL)
Defining data Objects in a database
Data organization, storage, and management
classify, organize, store, and manage various data
Determine the file structure and access methods of your organization's data
Achieve the link between data
Provides multiple access methods to improve access efficiency
Data manipulation Capabilities
Provides data manipulation language (DML)
Implement basic operations on a database (query, insert, delete, and modify)
Transaction management and operation management of the database
Database is managed and controlled by DBMS in establishment, operation and maintenance
Ensure data security, integrity, and concurrent use of data by multiple users
Transaction recovery after a failure

Database management

What Is Data management
Classify, organize, encode, store, retrieve, and maintain data
Central issues in data processing
The development process of data management technology
Human Management phase (the mid 1940s – 50)
File system phase (the late 1950s – 60)
Database system phase (the late 1960s – present)

Database system Features

Structured data
High data sharing, low redundancy, easy expansion
High data independence
Unified management and control of data by DBMS
The structure of the whole data is one of the main characteristics of the database
Holistic Structuring
Not just for one application, but for the whole organization
Not only the internal structure of the data, the whole is structured, the data have a link between

The real structure of the data is implemented in the database
The structure of the data is described with a data model, without the need for program definition and interpretation
Data can grow longer
The minimum access unit for the data is the data item

The database system treats and describes the data from the whole angle, and the data is oriented to the whole system, which can be shared by multiple users and multiple applications.
Benefits of data sharing
Reduces data redundancy and saves storage space
Avoid incompatibility and inconsistencies between data
Make the system easy to expand
Physical independence
The user's application is independent of the data stored in the database on disk. When the physical storage of data changes, the application does not have to change.
Logical Independence
The logical structure (logical mode) of the user's application and database is independent of each other. The logical structure of the data has changed, and the user program can remain unchanged.
Data independence is guaranteed by the DBMS's Level two image feature

DBMS提供的数据控制功能(1)数据的安全性(Security)保护保护数据,以防止不合法的使用造成的数据的泄密和破坏。(2)数据的完整性(Integrity)检查将数据控制在有效的范围内,或保证数据之间满足一定的关系。(3)并发(Concurrency)控制对多用户的并发操作加以控制和协调,防止相互干扰而得到错误的结果。(4)数据库恢复(Recovery)将数据库从错误状态恢复到某一已知的正确状态。
Data model

Abstract: It is from many things to pull out the common, essential characteristics, and abandon its non-essential characteristics. such as apples, bananas, pears, peaches, and so on, their common characteristic is fruit. The process of drawing fruit concept is an abstract process. To be abstract, comparisons must be made, and there is no comparison to find the parts that are essentially common. Common characteristics are those features that distinguish a kind of thing from his class, and these distinguishing features are also called essential features. So the common feature of extracting things is to extract the essential characteristics of things and discard the non-essential features.
The data model is divided into two categories (two different levels)
(1) The conceptual model is also called the information model, which models data and information according to the user's point of view, and is used for database design.
(2) Logical model and physical model
The logical model mainly includes network model, hierarchical model, relational model, object-oriented model, and so on, according to the viewpoint of computer system, it is used for DBMS implementation.
A physical model is an abstraction of the lowest level of data, describing how and how data is represented inside the system, how it is stored on disk or tape, and how it is accessed.

Data

What is a data structure
Describes the constituent objects of a database, and the connections between objects

Description of the Content
Objects related to data type, content, and nature
Objects related to data connection
Data structure is a description of the static characteristics of the system

Data manipulation

Data manipulation
The instances (values) of various objects (types) in the database allow the execution of
Operation and related rules of operation
Types of data operations
Inquire
Updates (including insert, delete, modify)
Definition of operations by the data model
The exact meaning of the operation
Operation symbols
Action rules (such as priority)
Language to implement operations
Data manipulation is a description of the dynamic characteristics of the system

Integrity constraints for data

Integrity constraints for data
A collection of set of integrity rules.
Integrity rules: The constraints and dependencies of data and their relationships in a given data model
It is used to limit the state of the database and the state of the data model to ensure the correct, effective and compatible data.
Definition of integrity constraints for the data model
Reflect and stipulate the basic general integrity constraints that this data model must adhere to. For example, in a relational model, any relationship must meet two conditions for entity integrity and referential integrity.
Provides a mechanism for defining integrity constraints to reflect the specific semantic constraints that the data involved in a particular application must adhere to.

Conceptual model

Purpose of the conceptual model
Conceptual models for modeling the information world
is a middle level of the real world to the machine world.
is a powerful tool for database design
The language of communication between the Database Designer and the user
Basic requirements for the conceptual model
Strong ability of Semantic expression
Ability to easily and directly express various semantic knowledge in the application
Simple, clear and user-friendly

Basic concepts in the information world
(1) 实体(Entity) 客观存在并可相互区别的事物称为实体。可以是具体的人、事、物或抽象的概念。(2) 属性(Attribute) 实体所具有的某一特性称为属性。一个实体可以由若干个属性来刻画。  (3) 码(Key) 唯一标识实体的属性集称为码。(4) 域(Domain) 属性的取值范围称为该属性的域。 (5) 实体型(EntityType) 用实体名及其属性名集合来抽象和刻画同类实体称为实体型。(6) 实体集(Entity Set) 同一类型实体的集合称为实体集(7) 联系(Relationship)  现实世界中事物内部以及事物之间的联系在信息世界     中反映为实体内部的联系和实体之间的联系。实体内部的联系通常是指组成实体的各属性之间的联系实体之间的联系通常是指不同实体集之间的联系
Common data Models

Non-relational model
Hierarchical models (hierarchical model)
Mesh models (Network model)
Relational models (relational model)
Object-oriented models (oriented model)
Object Relational Model (relational)

Hierarchical model

Hierarchical model is the earliest data model in database system
The typical representative of a hierarchical database system is IBM's IMS (Information Management System) database management systems
The hierarchical model uses a tree structure to represent various entities and the relationships between entities.
Hierarchical model
A collection of basic levels of contacts that meet the following two conditions is a hierarchical model
1. There is only one node with no parent node, this node is called the root node
2. Nodes other than the root have only one parent node
Several terms in a hierarchical model
root node, parent node, sibling node, leaf node
Features of the hierarchical model:
The parents of the knot are the only ones.
Only one-to-many entity contacts can be processed directly
Each record type can define a sort field, also known as a Code field
Any record value can show its full meaning only if it is viewed by its path
No child record value can exist independently from the parent record value
Advantages
Hierarchical model data structure is relatively simple and clear
High query efficiency, better performance than relational model, no less than mesh model
Hierarchical data model provides good integrity support
Disadvantages
Many-to-many connections mean unnatural.
More restrictions on insert and delete operations, more complex application authoring
Querying the child's node must pass through the parent node.
Hierarchical commands tend to be programmed due to their tight structure

Mesh model

Mesh database system using mesh model as data organization method
The typical representative is the DBTG system:
Also known as the CODASYL system
A system solution proposed by DBTG in the 70 's
Lays down the basic concept, method and technology of database system
Actual system
Cullinet Software Inc. 's IDMS
UNIVAC Company's DMS1100
Honeywell Company's IDS/2
HP Company's image
Mesh model
A collection of basic hierarchical contacts that meet the following two conditions:
1. Allow more than one node to be free of both parents;
2. A single node can have more than one parent.
Presentation method (same as hierarchical data model)
Entity type: Description with record type
Each node represents a record type (entity).
Properties: Description with Field
Each record type can contain a number of fields
Contact: Indicates the record type (entity) with the connection between nodes.
A one-to-many paternity link between

Data structure of the mesh model

The difference between network model and hierarchical model
Mesh model allows multiple nodes to be free of parental nodes.
Mesh model allows nodes to have multiple parent nodes.
Mesh model allows multiple connections between two nodes (composite contact)
The mesh model can be more directly described in the real world.
A hierarchical model is actually a special case of a mesh model

Relational model

relational database system using relational model as data organization method
1970 E.f.codd, a researcher at the San Jose Lab at IBM, first proposed a relational model of database systems
The new database management system of computer vendors almost supports the relational model

Data structure of relational model

Relationship (Relation)
A relationship corresponds to a table usually said
Tuple (tuple)
A single row in a table is a tuple
Properties (Attribute)
A column in the table is a property, giving each property a name, which is the property name
Main code (KEY)
A property group in a table that can uniquely determine a tuple.
Domains (Domain)
The range of values for the property.
Component
A property value in the tuple.
Relationship Mode
Description of the relationship
Relationship name (attribute 1, property 2, ..., attribute N)
Student (school number, name, age, gender, department, Grade)
Advantages
Based on a rigorous mathematical concept.
Single concept
Entities and all types of linkages are expressed in relation to
The results of data retrieval are also related
The access path of the relational model is transparent to the user
Higher data independence, better security confidentiality
Simplifies the work of programmers and the creation of database development

Database-Introduction to Databases

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.