Download code engineering sets

Transcript
2
MagicDraw Code Engineering
Database Engineering
CREATE TABLE ShortPKExample (
col1 INTEGER,
col2 INTEGER,
PRIMARY KEY (col1, col2)
);
If the order of columns within the primary key is important, constraint representation as
an operation with parameters must be used:
CREATE TABLE NoShortPKExample (
col1 INTEGER,
col2 INTEGER,
PRIMARY KEY (col2, col1)
);
Primary key constraint with overhead info
Consider such primary key definition using UML concepts and generated DDL script:
<<table>>
PKWithOverheadExample
-col2 : INTEGER
<<unique>>
-col1 : INTEGER
<<PK>>
+pk( col1, col2 )
CREATE TABLE PKWithOverheadExample (
col1 INTEGER UNIQUE,
col2 INTEGER,
PRIMARY KEY (col1, col2)
2-58
© 2005 No Magic, Inc.