The data model is an abstract model in which objective things in the real world are interconnected.
(1) A data Model is a set of integrated concepts that users describe and manipulate data within an organization, the relationships between data, and constraints on data, which contain data structures, operations, and integrity constraints
(2) The conceptual model is also known as the entity-contact (E-R) model, which is mainly used to describe the relationships of entities in the information world.
Concepts used in conceptual models to describe their data (entities, attributes, entity types, entity sets, codes, contact types between entity sets, etc.)
(3) entity : An objective and differentiated thing, an entity can be a specific person, thing, or abstract concept, for example: A student, a city, a course, etc.
(4) attribute : is used to describe the characteristics and properties of an entity, an entity has several characteristics, each of which is called an attribute of the entity, entities with the same attributes have the same characteristics and attributes, the property can not be independent of the existence of the entity,
If the student is an individual, it can also be understood as an entity, whose attributes include school number, name, gender, date of birth, etc.
(5) entity type : Use entity name and attribute name set to describe homogeneous entity, called entity type, for example, multiple students are a collection of homogeneous entities,
The definable type is the student (school number, name, gender, and date of birth as a set of attribute names for this type of entity), which is the public property of multiple students
(6) entity set : A collection of all the information of a number of homogeneous entities, consisting of the personal information of multiple students
(7) code : If a property or the value of an attribute set uniquely identifies an entity in an entity set, the attribute or set of properties can be called a code (Key)
can also be referred to as the main attribute, and vice versa, is understood as: "Student" entity concentration can be a number as a code, if the entity set without the name of students
Then the "name" attribute as a code, if the entity set has the same name, but its gender is different, you can "names and gender" two attributes of the union as a code
(8) Contact : is the association between two or more than two entity sets, understood as: "Student" entity set, there is a student-related "class" entity set
Records the class status set by a college so that the "student" and "class" two entity sets constitute a link
Relationship models (relational model) in the so-called relationship
It refers to a data set relationship that is sorted by some parallel sequence, although it has relevance rather than a property.
Data structure : is used to describe the static characteristics of the display system, it not only to describe the entity itself, but also to describe the relationship between entities
component: in a relationship, each data can be regarded as an independent component, the component is the smallest unit of the relationship, and the entire component of a relationship constitutes the entire contents of the relationship.
tuples : In a relationship, each of the rows is called a tuple, and several parallel, relatively independent tuples are composed of several attributes, and many of the properties of the tuples are arranged horizontally.
tuples correspond to several parallel, relatively independent entities in an entity set, and several attribute groups of each entity are the properties of tuples
Properties : in a relationship, each vertical column is called an attribute, and the property corresponds to the entire information of one property of the entity set
Relationship Mode
In a relationship, there is a relationship name, and each property has a property name, and a collection of relationship names and attributes that describe the relationship structure is often referred to as relational patterns
The relationship pattern corresponds to the entity type in the conceptual model.
Code : is an important concept in the relational model, there are several
Super Code : can uniquely identify a tuple attribute or attribute set is called the Super code in the relational pattern
Candidate Code : If a property or set of attributes uniquely identifies a tuple and does not contain extra attributes, this property is called a candidate for the relational pattern
main code : in a relational model, the candidate code being used, or a particular candidate specified by the user, can be called the main code of the relational pattern
External Code : If a property or attribute set in a relationship is the main code of another relational pattern, then the attribute or attribute set is the outer code of the ruler, also called the foreign key
SQL Server database System concepts