Current location - Education and Training Encyclopedia - University rankings - Making college physics model
Making college physics model
Recently, in the process of studying UML, I suddenly forgot the difference between conceptual model, logical model and physical model in university database theory. Just review the internet and record here that database modeling is to analyze and abstract the real world, find out the internal relations, and then determine the structure of the database.

1. Conceptual model: it is the first abstraction from the real world to the information world, and determines the attribute relationship of domain entities. Represented by E-R diagram, it is mainly composed of three elements: entity, attribute and connection.

2. Logical model: it is the process of transforming a conceptual model into a specific data model, that is, according to the basic E-R diagram established in the conceptual structure design stage and the data model supported by the selected management system software (hierarchy, network, relationship and object-oriented), it is transformed into a corresponding logical model. This transformation should conform to the principles of relational data model. At present, the most popular is the relational model (corresponding relational database).

The transformation from E-R diagram to relational model is to solve how to transform the relationships between entities into relationships and determine the attributes and codes of these relationships. This conversion is usually carried out according to the following principles:

(1) When an entity is transformed into a relationship, the attribute of the entity is the attribute of the relationship, and the encoding of the entity is the encoding of the relationship.

(2) Contacts are also converted into relationships. Both the attributes of contacts and the codes of entities connected by contacts are converted into the attributes of relationships, but the codes of relationships will change according to the types of contacts. If so:

1: 1, and the codes of both entities become candidate codes of the relationship.

1: n connection, and the code of the N-end entity becomes the code of the relationship.

M: n connection, the entity codes at both ends are combined into the code of the relationship.

3. The physical model is a machine realization corresponding to a specific data model according to the logical model. A physical model is a description of a real database. For example, some objects in a relational database are tables, views, fields, data types, lengths, primary keys, foreign keys, indexes, constraints, nullability and default values.