Principle of "self-taught" database system (II.)--Detailed (database design and ER model)

Source: Internet
Author: User

Everything has a life cycle, of course, the database system is no exception!

Database design and ER model This chapter is mainly based on the life cycle of the database system, the design phase of which to explain.

Let's take a look at the life cycle of the database system:

, the life cycle of database system is divided into five stages: planning, requirement analysis, design, realization, operation and maintenance . The design phase includes three aspects of concept, logic, and physics .

The following two sections are focused on conceptual design and logical Design in the design phase, as well as transformation from conceptual design to logical design .



I. Conceptual design (ER model)

The first chapter is about the four models of data abstraction: The conceptual data model, the logical data model, the external data model, and the internal data model, so in this chapter, we mention the concept and logic of the two words, certainly not unfamiliar.

In the first chapter, the concept model is modeled from the point of view of user demand. And our ER model is widely adopted conceptual model design method. Since it's a design approach, we'll explore how to use it.

1. Elements contained in the ER modelin the top map we see that the elements of the ER model are two: entities and relationships. But let's not forget that it also has entities and relationships that both contain attribute elements.
(1) entity: entity: object;entity set: class;entity type: The definition of the object.
(2) Contact: Contact: the relationship between entities;Contact Set: A collection of contacts of the same type;Contact Type: definition of contact.    (3) attribute classification: Simple and composite properties: divided by whether the parent attribute can be decomposed into sub-attributes, there is a dependency between the decomposed sub-attributes. Can be decomposed into composite properties, non-decomposed as simple attributes. Single-valued and multivalued attributes: depending on how many values are taken, you can take a multi-valued attribute as a multivalued attribute and take a single value as a single-valued attribute. store attributes and derived properties: store partitioning as necessary. There is no need to store the property as a derived property, and it is necessary to store it for storage. properties allowed to be null: when there are null values in the database, there are a number of situations that can be difficult to handle and to analyze all the cases.
2. Er model operation and design(1) ER model operation: including merging, splitting, adding and deleting, and other operations. (2) The design of ER model follows a principle: first local, then global, then optimized.
Ii. Logical design (relational model)the logical model is based on the view of database implementation, modeling data. The relational model is a data model that uses key codes to represent the relationships between entities.
1. Terminology: attributes, relationship patterns, tuples, relationships, attribute values. The entire two-dimensional table is a relational pattern, the attribute is a field in a two-dimensional table, the attribute value is a field value, and a tuple represents a record, and a relationship represents a collection of multiple records.

2. Follow the integrity rules (1) Entity: The primary key attribute cannot be a null value. (2) Reference: Do not allow references to entities that do not exist. (3) User defined: Set integrity rules for specific constraints.
Iii. Conceptual Design--Logic design 1. AlgorithmThe conversion of entity type and contact type to relational mode is described respectively. All the same, attributes, attributes, identifiers, etc. become keys. 2. Design Steps(1) Export initial relationship set: Global ER Model--Relationship mode(2) Normalization: Reducing exceptions in relational mode(3) mode evaluation: Check the function and performance to meet the user's requirements(4) mode correction: revise according to the evaluation result(5) Design sub-pattern: Design local Logical Structure
Iv. Summarylooking at their own map, according to the map to recall the content, that the book is actually very simple. Although the mesh is not very much, in an effort to make these knowledge become their own. In the process of learning to realize a lot of their shortcomings, for example, weaving network is not strong, low learning efficiency. Now is one thing to do these things, since the use of tomato template, efficiency is improved a lot, learning is not as aimless as before. Here, thank you, sister! Adhere to the use of tomato templates, so that their efficiency more and more high! Come on!      
  

Principle of "self-taught" database system (II.)--Detailed (database design and ER model)

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.