27
Firmas Sybase CASE (Computer Aided System Engineering) rīks PowerDesigner 16. versija

datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

  • Upload
    vothuy

  • View
    214

  • Download
    0

Embed Size (px)

Citation preview

Page 1: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

Firmas Sybase CASE (Computer Aided System Engineering) rīks PowerDesigner 16. versija

Page 2: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

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

Page 3: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

PowerDesigner distribūti: Sākums:

Modeļu veidi:

3

Page 4: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

4

Page 5: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

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

Page 6: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

6

Page 7: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

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

Page 8: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

ER (Entity Relationship) diagrammas veidošana

Datu grupu (realitāšu) un asociāciju karkasu izveidošana

8

Page 9: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

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

Page 10: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

3. Potenciālo primāro atslēgu definēšana

10

Page 11: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

Saišu definēšana1. Saites starp datu grupējumiem definēšana

Saišu definēšana

11

Page 12: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

2. Saites starp datu grupējumu un asociāciju definēšana

12

Page 13: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

Iegūtā ER diagramma (konceptuālais modelis)

Tools Check Model 0 error(s), 0 warning(s).

13

Page 14: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

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

Page 15: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

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

Page 16: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

Datu bāzes definējošā apraksta izveidošana

16

Page 17: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

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

Page 18: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

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

Page 19: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

DB XML modeļa ģenerēšana

Tools Generate XML Model ...

Iegūtās XML dokumenta shēmas apskate

19

Page 20: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

Saites daudzi ar daudziem modelēšana (N : M)

Konceptuālais modelis

Loģiskais modelis

Fiziskais modelis

20

Page 21: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

Saites ar sevi modelēšana (1 : N)

Konceptuālais modelis

Loģiskais modelis

Fiziskais modelis

21

Page 22: datubaze.files.wordpress.com€¦  · Web view04/03/2013 · Konceptuālais, loģiskais un fiziskais datu modelis. A conceptual data model (CDM) helps you analyze the conceptual

Mantošanas (inheritance) modelēšana

Konceptuālais modelis

Loģiskais modelis

Fiziskais modelis

22