Upload
vothuy
View
214
Download
0
Embed Size (px)
Citation preview
Firmas Sybase CASE (Computer Aided System Engineering) rīks PowerDesigner 16. versija
Konceptuālais, loģiskais un fiziskais datu modelis
A conceptual data model (CDM) helps you analyze the conceptual structure of an information system, to identify the principal entities to be represented, their attributes, and the relationships between them. A CDM is more abstract than a logical (LDM) or physical (PDM) data model. A CDM allows you to:
1) represent the organization of data in a graphic format to create Entity Relationship Diagrams (ERD);2) verify the validity of data design;3) generate a:
- Logical Data Model (LDM);- Physical Data Model (PDM);- Object-Oriented Model (OOM), which specifies an object representation of the CDM using the UML standard.
A logical data model (LDM) helps you analyze the structure of an information system, independent of any specific physical database implementation. An LDM has migrated entity identifiers and is less abstract than a conceptual data model (CDM), but does not allow you to model views, indexes and other elements that are available in the more concrete physical data model (PDM). You can use a logical model as an intermediary step in the database design process between the conceptual and physical designs:
1) start with a CDM containing entities, attributes, relationships, domains, data items and business rules. If need be, you may develop the CDM in several design steps starting from a high level model to a low level CDM.2) generate an LDM. Create indexes and specify FK column names and other common features;3) generate one or more PDMs, each targeted to a specific DBMS implementation.
This design process allows you to keep everything consistent in a large development effort.
A physical data model (PDM) helps you to analyze the tables, views, and other objects in a database, including multidimensional objects necessary for data warehousing. A PDM is more concrete than a conceptual (CDM) or logical (LDM) data model. You can model, reverse-engineer, and generate for all the most popular DBMSs.
2
PowerDesigner distribūti: Sākums:
Modeļu veidi:
3
4
Supported CDM/LDM NotationsPowerDesigner supports the most popular data modeling notations in the CDM and LDM. You can choose your notation by clicking Tools > Model Options and selecting it in the Notation list.
5
6
Datu diagrammās izmantojamās notācijas un simboli
Tools Model Options ...
Pamatsimboli:
1. Pakete2. Būtība, realitāte, lieta3. Saite (starp realitātēm)4. Mantošana5. Asociācija6. Asociācijas saite7. Fails
7
ER (Entity Relationship) diagrammas veidošana
Datu grupu (realitāšu) un asociāciju karkasu izveidošana
8
Realitātes parametru definēšana (Model Model properties)1. Datu grupas Firma vispārējo datu ievade un norāde
2. Datu grupas Firmas atribūtu definēšana
9
3. Potenciālo primāro atslēgu definēšana
10
Saišu definēšana1. Saites starp datu grupējumiem definēšana
Saišu definēšana
11
2. Saites starp datu grupējumu un asociāciju definēšana
12
Iegūtā ER diagramma (konceptuālais modelis)
Tools Check Model 0 error(s), 0 warning(s).
13
The Conceptual Data Model is correct, no errors were found.
DB loģiskā modeļa ģenerēšana
Tools Generate Logical data Model
Tools Check Model ...0 error(s), 0 warning(s).The Logical Data Model is correct, no errors were found.
14
DB datu fiziskā modeļa ģenerēšana
Tools Generete Physical Data Model
Tools Check Model ...0 error(s), 1 warning(s).The Physical Data Model is correct, no errors were found.
15
Datu bāzes definējošā apraksta izveidošana
16
Iegūtais datu bāzes definējums SQL valodā
alter table "Apaksuzdevums" drop constraint FK_APAKSUZD_AP_SAITE_UZDEVUMS;alter table "Darbinieks" drop constraint FK_DARBINIE_STRĀDĀ_FIRMA;alter table "Izpilda" drop constraint FK_IZPILDA_IZPILDA_UZDEVUMS;alter table "Izpilda" drop constraint FK_IZPILDA_IZPILDA2_DARBINIE;drop table "Apaksuzdevums" cascade constraints;drop table "Darbinieks" cascade constraints;drop table "Firma" cascade constraints;drop table "Izpilda" cascade constraints;drop table "Uzdevums" cascade constraints;
create table "Apaksuzdevums" ( AP_NUM INTEGER not null, U_NUM INTEGER not null, AP_NOS VARCHAR2(20), constraint PK_APAKSUZDEVUMS primary key (AP_NUM));
create table "Darbinieks" ( D_NUM INTEGER not null, F_NUM INTEGER not null, UZV VARCHAR2(30) not null, VAR VARCHAR2(20) not null, AMATS VARCHAR2(20), ALGA NUMERIC(7,2), constraint PK_DARBINIEKS primary key (D_NUM));
create table "Firma" ( F_NUM INTEGER not null, F_NOS VARCHAR2(30) not null, DIBIN_DAT DATE, TELEF CHAR(11), DAT_NO DATE, DAT_LIDZ DATE, constraint PK_FIRMA primary key (F_NUM));comment on table "Firma" is 'Firmas datu kopa jeb datu grupa';
17
create table "Izpilda" ( D_NUM INTEGER not null, U_NUM INTEGER not null, SAK_DAT DATE, BEIGU_DAT DATE, constraint PK_IZPILDA primary key (D_NUM, U_NUM));
create table "Uzdevums" ( U_NUM INTEGER not null, U_NOS VARCHAR2(20), constraint PK_UZDEVUMS primary key (U_NUM));
alter table "Apaksuzdevums" add constraint FK_APAKSUZD_AP_SAITE_UZDEVUMS foreign key (U_NUM) references "Uzdevums" (U_NUM);alter table "Darbinieks" add constraint FK_DARBINIE_STRĀDĀ_FIRMA foreign key (F_NUM) references "Firma" (F_NUM);alter table "Izpilda" add constraint FK_IZPILDA_IZPILDA_UZDEVUMS foreign key (U_NUM) references "Uzdevums" (U_NUM);alter table "Izpilda" add constraint FK_IZPILDA_IZPILDA2_DARBINIE foreign key (D_NUM) references "Darbinieks" (D_NUM);
18
DB XML modeļa ģenerēšana
Tools Generate XML Model ...
Iegūtās XML dokumenta shēmas apskate
19
Saites daudzi ar daudziem modelēšana (N : M)
Konceptuālais modelis
Loģiskais modelis
Fiziskais modelis
20
Saites ar sevi modelēšana (1 : N)
Konceptuālais modelis
Loģiskais modelis
Fiziskais modelis
21
Mantošanas (inheritance) modelēšana
Konceptuālais modelis
Loģiskais modelis
Fiziskais modelis
22