Conceptual data modeling (first experience) with PowerDesigner

zhaozj2021-02-16  66

Originally, it is ready to catch some pictures, explained by an example, because the machine is just loaded, and there is no graphic and processing tool, so it is lazy to write.

Let's explain the CDM and PDM before starting.

Concept Data Model (CDM)

Conceptual design tools for information systems, ie entities - contact maps (E-R), CDMs describe E-R in their own way. At this time, the details of the physical implementation are not considered, only the overall logical structure of the database is independent of any software and data storage structure.

Physical Data Model (PDM)

PDM considers the physical implementation of the database, including software and data storage structures. PDM Object: Table (Table Column), PRIMARY & Foreign Key, Reference (Reference), Index (INDEX), View (View), etc.

Let's talk about my understanding of CDM by creating a CDM project.

1. Create a CDM project and set its properties. 2. Define domains: Generally before starting, we have to define some domains for the CDM model, and some of the roles of the domain have some pixel data, which defines the data structure of a certain type of data. By defining a domain, you define a data structure, you can reference it in the project. When doing this, once you change the properties of a domain, all the references in the entire project will change. For example, you define a domain name MY_MONEY, the data type is Money, the number of integer bits is 8, and the number of small digits is 3. After you reference the Money domain in the data item (DataItem) PAY and GET, the data type of the data item is automatically changed to MONEY. If you add a small number of Money types, you only need to change my_money this domain, all of which references the data items of My_MONEY this domain will change. 3. Establish an entity: After establishing an entity, set the properties, modify the name, increase attributes, each attribute is a data item in the CDM, and then converted into a PDM as a field in the table. In the properties bar you can set some of its features for any Attribute. DataYpe, Domain, M, P, P, respectively, respectively. DataType is the data type, and if the domain is referenced, it is not required. Domain is the reference domain. M, P, D is: whether it must be filled, whether it is a primary key, whether it can be displayed, these three properties can be multi-selected, when you choose P, M is also automatically selected, and an identifier is also available in Identifiers. The role of the identifier is also relatively large, in the RELATIONSHIP, it corresponds to it. 4. Establish contact: Select RelationShip to make a touch to establish a connection between two entities, double-click the contact will display its properties, which can set the relationship between the two entities, including one-on-one, one More, more, more, more. For example, the Class table and the Student table are a couple of relationships. After the one-to-many entity relationship is converted into PDM, the primary key of the first entity will be stored as the outer key of the second entity, such as the primary key of the Class table. Class_ID will make the foreign key of STUDUENT. 5. Creating a child model: The child model is equivalent to the solid relational table we usually, the diamond portion in the ER. The child model is used in many-multi-relationships. Such as Class tables and Teacher tables, there is a multi-to-many relationship between them. To implement links between the two entities, a child model is required, and the sub-model is established to link multiple entities with Association Link. The PDM neutron model is also a physical table, and the primary key of each entity it is related to the field of the child model table. At the same time, the child model can also add some other Attribute. 6. Establish inheritance: Inheritance is similar to our inheritance in programming, with a parent entity as a baseline, all sub-entities will have all Attribute in the parent entity. Other Attribute can be defined in the sub-entity to distinguish between other sub-entities. (I have some confused to inheritance relationship, I can't find the corresponding model in the ER diagram. I have discuss it with my parent table. I have discussed with my colleagues. I have no results. I also hope that everyone will give me.

转载请注明原文地址:https://www.9cbs.com/read-19366.html

New Post(0)