Our original Entity-Relationship Diagram is shown as above. To transfrom the ER
Model, we simplify it in several by combine similar entities and relationships.
we merge all the subtypes of Publication into one entity, and
all the subtypes of Collection into one entity. Consequently, the
"Publication.ID" is a foreign key of Collection.
All three kinds of relatonship collect are merged in one, and since
collect is a 1-m relationship, we furtherly transform it as an attribute,
the Publication.in_collection, which is a foreign key from Collection.
We combined the Author
and Editor into Person, and write and edit are merged into publish relation
distincted by "type" attribute.
Since name is a multi-valued attribute, we add another has relation into the
schema, where the "name" and ""Person.ID" is the primary key.
The result ER Diagram is shown below:
Relation Schema
We write our relation schema according to the transformed ER Diagram. (See the
UML diagram below):
Person (person_id: NUMBER, affliation: VARCHAR2(200), homepage: VARCHAR(200))
In Publication, the "type" can be book, proceeding, journal, article,
inproceeding, and incollection. An article is collected inside a book, an inproceeding
is collected inside a proceeding and an incollection is collected inside a collection. These relations
are represented by the self referencing foreign key of "in_collection".
Inside Collection, more attributes about books, proceedings and journals are stored.
In publish, type can be "write" or "edit".
Commands & Screenshots
Publication
CREATE TABLE publication (
publication_id NUMBER,
in_collection NUMBER,
title VARCHAR2(200),
year INTEGER,
pages INTEGER,
ee VARCHAR2(200),
url VARCHAR2(200),
type VARCHAR2(32),
CONSTRAINT ck_type_publication
CHECK (type = 'inproceeding' OR type = 'incollection' OR type = 'article' OR
type = 'book' OR type = 'proceeding' OR type = 'journal'),
CONSTRAINT pk_publication
PRIMARY KEY (publication_id),
CONSTRAINT fk_collection_publlication
FOREIGN KEY (in_collection)
REFERENCES publication(publication_id)
);
Model Transformation
Our original Entity-Relationship Diagram is shown as above. To transfrom the ER Model, we simplify it in several by combine similar entities and relationships.
The result ER Diagram is shown below:
Relation Schema
We write our relation schema according to the transformed ER Diagram. (See the UML diagram below):
NUMBER
, affliation:VARCHAR2(200)
, homepage:VARCHAR(200)
)NUMBER
, in_collection:NUMBER
, title: VARCHAR2(200), year:INTERGER
, pages:INTERGER
, ee:VARCHAR2(200)
, url:VARCHAR2(200)
, type:VARCHAR2(32)
)NUMBER
, booktitle:VARCHAR2(200)
, publisher:VARCHAR2(200)
,volume:INTEGER
)VARCHAR2(200)
, person_id: `NUMBER**)NUMBER
, publication_id:NUMBER
, type:VARCHAR2(32)
)NUMBER
, successor:NUMBER
)NUMBER
, successor:NUMBER
)Notes
book
,proceeding
,journal
,article
,inproceeding
, andincollection
. An article is collected inside a book, an inproceeding is collected inside a proceeding and an incollection is collected inside a collection. These relations are represented by the self referencing foreign key of "in_collection".Commands & Screenshots
Publication
Person
Collection
Name
Publish
Coauthor
Cite
deliverable3.pdf