The overview

1. Basic database concepts

What is Data?

Data is a symbolic record describing things. It refers to identifiable information recorded by physical symbols

E.g. Joe Smith, occupation: iOS development engineers, the company: LINE, 🐮 🍺 no: 🐮 🍺,…

E.g. text data of characters, multimedia data of graphics and images, etc

Everything is data, data is only a form of information exists, only through the interpretation or processing of data, can become useful information

Data semantics

Data interpretation is the description of the meaning of data, also known as data semantics

What is a Database?

A database is an organized, shareable set of data stored in a computer for a long time

It’s a warehouse where data is stored

Databases have three characteristics: permanent storage, organization, and sharing

Database Management System (DBMS) and its functions

Database management system is a set of software that is used to establish and manage database, which is between application program and operating system

Functions of the database management system

  1. Data Definition Language (DDL)
  2. Data Manipulation Language (DML)
  3. Database operation management function
  4. Database establishment and maintenance functions
  5. Data organization, storage and management functions
  6. Network communication with other software
  7. Data transfer and mutual access between different database management systems

The composition of Database System (DBS)

  1. User (programmer)
  2. User (database terminal user)
  3. The application
  4. Database Management System (DBMS)
  5. Database Administrator (DBA)
  6. The database (DB)

2. Development of database management technology

Manual management stage

Period: before the mid-1950s

Features:

  1. Data not saved
  2. Applications manage data
  3. The data is application oriented

Pictured above,

File system phase

Period: late 1950s to mid-1960s

Features:

  1. Data can be stored for a long time
  2. Specialized management

Pictured above,

Database system phase

Period: late 1960s

Features:

  1. Data integration
  2. Data sharing is high
  3. Low data redundancy
  4. Data consistency
  5. High data independence
  6. Implement unified management and control
  7. Reduce application development and maintenance effort

3. Structure of the database system

The structural classification of a database system

  1. From the perspective of DBA, it is divided into internal system structure and external system structure

The internal system structure adopts three-level mode, which is divided into mode, internal mode and external mode

The external system structure is divided into centralized structure, distributed structure and parallel structure

  1. From the user perspective of database application, it is divided into client/server structure and browser/server structure

Client/Server structure (C /S)

The task of the C side is to complete the interaction task with the database consumer

The S side is mainly responsible for data management

Of course, they have many other nicknames, such as

The C side we can also call foreground, client, presentation layer

The S side we can also call the backend, the server, the data layer

Pictured above,

Browser/Server (B /S)

The B side is the browser, and the S side is the server. The browser belongs to a Web application of the client, so this structure can also be called the C/S structure based on Web applications, also known as the three-tier C/S structure

Pictured above,

The three-level schema structure of a database system

External mode, also known as submode or user mode, can be understood as different external modes that correspond to different permissions to view data

Patterns, also known as conceptual or logical patterns

Internal mode, also known as storage mode

Model name Model nickname The view type
model Conceptual/logical patterns Conceptual view
Outside the model Submode/user mode Data view, user view
In the model Storage mode Internal view, storage view

Pictured above,

Two-tier image and data independence for the three-tier schema

What is an image

An image is a correspondence rule that says how are the two sides of the image transformed

Image classification

  1. Pattern/inner pattern image ensures the physical independence of data from the program above

  2. External schema/schema image ensures logical independence of data and program above

4. Data model

What is a Model?

A model is a simulated and abstract representation of real-world features

A Data Model is an abstraction of the characteristics of real-world Data and describes the common content of Data

Characteristics of data

It is divided into static features and dynamic features

The static characteristics of the

* Basic structure of the data

* Links between data

* Constraints on the range of data values

The dynamic characteristics of the

* Refers to the operation that can be performed on the data according to certain rules

Data model components

  1. Data structure, system static characteristics, including the data types of data objects, content, properties, and the relationship between data objects
  2. Data operation, system dynamic characteristics
  3. Data constraints, syntactical and semantic associations between data in data structures

Classification of data models

  1. Conceptual models, the transition from the real world to the information world
  2. Logical model and physical model, information world to machine world transformation

What is Conceptual Model?

The conceptual layer is the highest level of data abstraction. Conceptual data models, also known as conceptual models or information models, are mainly used in the design phase of databases

The basic concepts involved in the information world

An Entity, “Entity,” refers to something that exists objectively and can be distinguished from each other. An Entity can be a real thing or an abstract concept, such as a student or a course

Attributes: Attributes that an entity has are called attributes of the entity. For example, students have attributes such as student number, name, and gender

A property that uniquely identifies an entity is called a code or Key. : a student number is a student’s code or key

Domain. The value range of an attribute is called the Domain of the attribute. For example, the attribute of the student’s gender, the domain is male or female

An Entity Type abstracts the same Type of Entity with the Entity name and attribute set. For example, a student (student number, name, gender) is an entity

An Entity Set is a collection of entities of the same type. For example, each student is an entity, and all students constitute a set of entities

The relation within the entity (type) and the relation between the entities (type), the internal relation refers to the relation between attributes, and the relation between entities refers to the relation between different entities

Type (type), equivalent to the header of a table, name, sex, age, native place, telephone number

Value, equivalent to the data in each row of the table, Zhang SAN, male, 18, Beijing, 13611112222

Representation of conceptual models

The E-R diagram is used to represent the conceptual model figure

Entity-relationship Approach

E-r Diagram (Entity-Relationship Diagram)

Solid type, represented by a rectangle, with the name of the entity indicated inside the box

Property, represented by an oval, with the name of the property indicated in the box and connected by a line to the corresponding entity

Connections, shown in diamonds, with the name of the connection in the box, the line to the entity concerned, and the type of connection (1:1, 1:N, M:N) on the line.

A connection can also have properties that are connected to the connection line

What is a Logical Data Model?

The logical layer is the middle layer of the data abstraction level. Logical layer data model, also known as the logical model of data. Any DBMS is based on some logical data model

Type of logical model

The hierarchical model

* One of the earliest data models

* There is only one node without a parent, called the root node

* Other nodes have only one parent

Mesh model

* Use a network structure to represent the connections between entities

* Allow nodes to have more than one parent

* You can have more than one node without a parent

The relational model

* Use a two-dimensional table structure to represent the connections between entities

* Based on strict mathematical concepts

* Single concept

* The access path is transparent to the user, with higher data independence and better security

This is the table that we use

Object Oriented model

* The data model formed by the combination of object-oriented method and database is called object-oriented model

* Both conceptual and logical models

* Rich expression ability, reusable objects, easy maintenance

What is a Physical Data Model?

The physical layer data model is the lowest abstraction of the database, also known as the physical model of the data. The design goal is to improve database performance and use storage space efficiently

The conceptual model The highest level of data abstraction, used primarily during the database design phase
The logical model In the middle of the data abstraction level, any DBMS is based on some logical data model
The physical model At the lowest level of the data abstraction level, the design goal is to improve database performance and use storage space efficiently

Relationships between conceptual models, logical models, and physical models

The three different data models are both independent and related.

The transformation from the real world to the conceptual model is done by the database designer

The transformation from the conceptual model to the logical model can be done by the database designer or with the assistance of a database design tool

The transformation from the logical model to the physical model is mainly done by the database management system

conclusion

See 35 years old programmer’s anxiety, although he has not yet entered 30, but, in this industry may also be an old rookie, not to say, enrich their own! Is not getting old, can not be a programmer; It’s getting old and not learning, so there is the anxiety of an old programmer!