The first section understands the relational database

Source: Internet
Author: User

1. Concept

A database, in fact, is a set of structured information. The purpose of database design is to manage a large amount of information. It takes an organized and structured approach to storing data, which makes it easy for users to manage and retrieve the data they need.

A database management system (DBMS) is a software program that allows users to create and maintain databases. The DBMS supports storing data as rows and columns in a table.

relational database management System (RDBMS) is a DBMS that stores information in related tabular form. RDBMS is based on DBMS.

2. Life cycle

The life cycle of a database defines the complete process of database implementation conceptually.

(1) Demand analysis: You must understand the requirements before starting and designing.

(2) Logical design: After defining requirements, define data and relationships, such as e-r diagrams, through the conceptualization of database modeling tools.

(3) Physical design: Physical design steps include the creation of tables and the selection of indexes.

(4) Database implementation: After the design is complete, it is created through the data definition language (DDL).

(5) Data modification: Data modification Language (DML) is used to query and update the database. It can also be used to establish indexes and constraints (referential integrity).

(6) Database monitoring: When operating the database, the monitor indicates whether the database meets the performance requirements. If not, the database needs to be adjusted to re-enter the monitoring, redesign, and modification phases.

3. Mapping ratio

The mapping ratio represents the number of other entities that an entity can associate through a relationship.

(1) A pair of relationships (1:1): For example, there can be only one department leader in each department.

(2) A one-to-many relationship (1:M): For example, multiple orders can belong to a customer.

(3) Many-to-many relationships (M:M): Usually through the "one-to-one" format, many-to-many relationships require a third table (join table) as the path between the two tables. For example, an order contains multiple products, and one product can belong to multiple orders.

4. Understanding of Keys

(1) Primary key: A property or combination of attributes that uniquely identifies a record in an entity.

(2) Foreign key: is the attribute in the relationship that is used to identify the parent entity. Foreign keys not only maintain the integrity of the data, but can also be used to connect different entities. Each relationship in the model must be supported by a foreign key.

5. Understanding of data integrity

Data integrity, indicating the correctness and consistency of data values in the database.

Among them, the existence and uniqueness of the primary key value guarantee the entity integrity. Referential integrity, however, requires that all foreign key values in the child table match the primary key value in the parent table, or, if allowed, be empty to satisfy the foreign key constraint.

6. Normalized normalization is the technique of minimizing duplication of data in logical database design, thus avoiding potential inconsistencies in the updates.

(1) First normal form (1FN): Columns with no duplicates

(2) Second normal form (2FN): The property is completely dependent on the primary key

(3) Third normal form (3FN): property is not dependent on other non-principal properties

The concept is very abstract, a friend of the park introduced a good: http://www.cnblogs.com/GISerYang/archive/2012/05/09/2491996.html

The first section understands the relational database

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.