After the concept of database was put forward, several data models appeared successively. There are three kinds of basic data models: Hierarchical model system, network model system, and relational model system. The relationship model proposed in the late 60 has the characteristics of simple and flexible data structure, easy to understand and strong mathematical foundation, and it has been popular since the 70 and has become the standard of database. The database software which is widely used is a relational database management system based on relational model.
3.2.1 Relational model (RM that relational models)
The relational model regards the world as being composed of entities (Entity) and connections (relationship).
An entity is an object in the real world that has the characteristics or attributes that distinguish it from other things and is associated with other entities. In a relational model, entities are usually expressed in a table Form. Each row of the table describes an instance of an entity, and each column of the table describes a feature or attribute of the entity.
The so-called connection refers to the relationship between entities, that is, the correspondence between entities. Contact can be divided into three kinds:
• One-to-one contact. such as: A person only one sex, a person → Sex for a one-to-one relationship;
• A one-to-many connection. For example: people of the same sex have many, sex → People for a one-to-many relationship;
• A many-to-many connection. For example: Many people have the same sex, people → Gender as a link to one another.
By contacting, you can use information from one entity to find information about another entity.
The relational model organizes all the data into tables. A table is made up of rows and columns, rows represent records of data, and columns represent fields in records. The table reflects facts and values in the real world.
3.2.2 Relational database (RDB that relational db)
The so-called relational database is a database based on the relational model.
1. Relational database management system (RDBMS)
• Relational database management system is the computer software that manages the relational database.
2, keyword (key)
The keyword is an important concept in the relational model, it is the logical structure, not the physical part of the database.
• Candidate Keywords (candidate key)
If an attribute set uniquely identifies a row of a table without extra attributes, the attribute set is called the candidate keyword.
• Primary keywords (Primary key)
The primary key is the selected keyword that is selected as the unique identifier for the row of the table. A table has only one primary key. The primary key can also be called a primary key.
• Public keywords (Common key)
In a relational database, relationships are represented by compatible or identical attributes or groups of attributes. If two relationships have compatible or identical attributes or attribute groups, then this property or group of properties is called the Public keyword of the two relationships.
• Foreign keywords (Foreign key)
If the public key is the primary key in a relationship, the public keyword is called an external keyword for another relationship. Thus, the external keyword indicates the connection between the two relationships. A table that takes the external keyword of another relationship as the primary key is called the primary table, and a table with the additional keywords is called the primary table from the table. An external keyword is also called a foreign key.
View a complete set of "MS SQL Primer Tutorials" >>>>>