• Keine Ergebnisse gefunden

Relational Databases I Exercise Sheet 03: Data Modeling 2 (30 points)

N/A
N/A
Protected

Academic year: 2021

Aktie "Relational Databases I Exercise Sheet 03: Data Modeling 2 (30 points)"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Relational Databases I

Exercise Sheet 03: Data Modeling 2 (30 points)

(due by Thursday, November 14, 2013)

Please note: You need 50% of all exercise points to receive the Studienleistung. Solutions have to be turned in on paper until Thursday before the lecture either in the lecture hall or into our mailbox (Informatikzentrum 2nd floor). Please write your matriculation numbers and your tutorial group number on your solutions! You may answer in German or English. You need to pass both the exercises and the exam for the RDB 1 module! Unless otherwise specified: Always use your own words!

Exercise 1 – Specialization and Generalization (9 points)

Briefly explain in your own words.

a) What are superclass and subclass entity types and how do they relate? (2 points)

b) What are the processes of specializing and generalizing entity types and how do they relate? (2 points)

c) Explain possible problems of an inheritance lattice and which of those problems can be prevented by using union types and why. (3 points)

d) Explain, why intermediate entities in Crow’s Foot Notation are not the same as n-ary relationship types in Chen Notation. Give an example! (2 points)

Exercise 2 – Quiz (4 points)

Decide if the following statements are (1) always true, (2) always false or (3) possibly true.

Explain your answers.

I. Given a total overlapping specialization between a superclass and two subclasses: If an entity is removed from a subclass, it must also be removed from its superclass. (2 points)

II. Given a partial disjoint specialization between a superclass and a subclass: If an entity is removed from the subclass, it must also be removed from its superclass. (1 point) III. A subclass has more attributes than its superclass. (1 point)

Exercise 3 – Union Types (7 points)

Union Types (also called categories) may be used to group together entity types that have no superclass in common. Model the following scenario using union types:

In Gotham city, super heroes and super villains known by their respective alias own assets that provide benefits in their fights versus evil (or good…). Each super hero or super villain may work for any number of corporations and can use the assets of these corporations as well. Corporations have a unique name and an address they might share with the headquarters of other corporations. An asset can be either a weapon, a building, or an employee. Weapons are identified by their serial number, a building by its address, and an employee by his/her passport id. All addresses are

composed of a street, street number, city, and country. No asset can exist without an owner and an owner may own any number of assets, but at least one.

(2)

Relational Databases I

Exercise 4 – EER Modeling (10 points)

Model the following miniworld in EER while documenting and explaining each non-trivial design decision:

In this world we have persons with an identifying Id, a name, a power-level and an evilness-level. A person with a power-level greater than 10 is considered a powered person. Each powered person is either a super villain, if its evilness is higher than 0, or a superhero otherwise. A superhero may have up to 2 sidekicks, while a person is only the sidekick of 1 superhero (or not a sidekick at all). A super villain may have any amount of persons as underlings, but has at least one, while a person may be an underling of several super villains. Both, sidekicks as well as underlings are regular persons but a sidekick is never an underling and vice versa.

Each person lives in at least one home which is identified by its address, consisting of country, street, nr and zip-code. A home does also have a number of residents. A home might even be an evil lair or a secret base (or both, if a hero and a villain rent an apartment in the same building). An evil lair does always contain a weapon of mass destruction, while a secret base contains a hero outfit.

Of course a hero always lives in at least one secret base and in each secret base lives at least one hero. The same goes for villains and evil lairs.

Referenzen

ÄHNLICHE DOKUMENTE

(Assuming that calculating parity does not consume any time. Also, note down if no concurrent write access cannot performed at all.).. Order the configurations by their

Solutions have to be turned in on paper until Thursday before the lecture either in the lecture hall or into our mailbox (Informatikzentrum 2nd floor)!. Please write

Given the relational database schema in Exercise 0 and based on the SQL syntax from the lecture, provide an SQL query for each of the following tasks:. a) A query for all

f) What are the candidate keys for R with respect to F? Explain your answer. Provide intermediate results for each of the following steps and explain how you reached them:. 1)

Based on the database schema build from your CREATE TABLE statements from Exercise 1 b), provide SQL CREATE VIEW statements for the following tasks:.. a) Create the

Is the relationship set r described in the following figure a valid instance of the relationship type R.. If not, list all conflicts that violate the constraints described in

Moreover, each event takes place at exactly one location and at each location several different events can

Decide whether the following statements are (1) always false, (2) always true, or (3) true in some cases but false in others. Explain your answers. a) The number of entities