The process of converting e-r diagrams into relational data models belongs to the "logical design stage". The main task is to design the conceptual data model of the real world into a logical model of the database, that is, adapted to a specific database management The logical data schema supported by the system.
The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.
The process of converting an e-r diagram into a relational data model belongs to the "logical design phase".
Logical structure design is to convert the conceptual model completed in the conceptual structure design stage into a data model that can be supported by the selected database management system (DBMS). Here we mainly convert the E-R model into a relational model. It is necessary to specify the global logical structure of the database after decomposing and merging the original data, including the determined keywords and attributes, the redetermined record structure and file structure, and the mutual relationships between the various files established to form Database administrator view of this database.
Logical structure design is generally divided into three steps:
1. Transformation from E-R diagram to relational model
The logical design of the database is mainly to convert the conceptual model into a general relational model, that is, to convert the entities, the attributes of the entities and the connections between entities in the E-R diagram into a relational model. During the conversion process, you will encounter the following problems:
(1) Naming problem. For naming issues, you can use the original name, or you can name it differently to avoid duplication of names.
(2) Non-atomic attribute problem. Non-atomic property problems can be expanded vertically and horizontally.
(3) Contact conversion problem. Contacts can be represented by relationships.
2. Optimization of data model
The result of database logical design is not unique. In order to further improve the performance of the database application system, the structure of the data model should be appropriately modified to increase the query speed.
3. Relational view design
The design of relational view is also called external schema design, also called user schema design, which is a data schema that users can directly access. In the same system, different users can have different relationship views. The relational view comes from the logical schema, but may differ from the logical schema in structure and form, so it is not a simple subset of the logical schema.
The relational view has three main functions:
(1) Shielding the logical mode through the external mode provides a certain degree of logical independence for the application.
(2) Better adapt to the different needs of different users for data.
(3) It defines different scopes for accessing data for different users, which is conducive to data confidentiality.
(Recommended tutorial: mysql video tutorial)
The above is the detailed content of What is the process of converting an e-r diagram into a relational data model?. For more information, please follow other related articles on the PHP Chinese website!