I am stuck on this Question for Information Modeling and Relational Databases: 4
ID: 3801979 • Letter: I
Question
I am stuck on this Question for Information Modeling and Relational Databases:
4. Assume the following conceptual schema.
Reference schemes: Person(.firstname)
Base fact types: F1 Person is male
F2 Person is female
F3 Person is a parent of Person
Constraints: C1 Each Person is a male or is female
C2 No Person is male and is female
C3 –Each person has at most 2 parents
Each Person(2) instance occurs at most 2 times in Person(1) is a parent of Person(2)
C4 No Person is a parent of itself
Derivation rules: D1 Person is a grandparent of Person(2) if
Person(1) is a parent of some Person(3) who is a parent of Person(2)
Assume the database is populated with the following data. The user now attempts the following sequence of updates and queries. Indicate the CIP’s response in each case,
Males: David, Paul, Terry
Females: Alice, Chris, Linda, Norma, Selena
(a) add: Person ‘Jim’ is male
(b) add: Person ‘Bernie’ is a parent of Person ‘Terry’
(c) begin
Person ‘Terry’ is a parent of Person ‘Selena’
Person ‘Norma’ is a parent of Person ‘Selena’
end
(d) add: Person ‘David’ is a parent of Person ‘David’
(e) begin
Person ‘Norma’ is a parent of Person ‘Paul’
Person ‘Alice’ is a parent of Person ‘Terry’
end
(f) add: Person ‘Chris’ is male
(g) add: Person ‘Chris’ is a parent of Person ‘Selena’
(h) what Person is a grandparent of Person ‘Selena’?
Formulate your own derivation rules for the following:
(i) X is a father of Y
(j) X is a daughter of Y
(k) X is a granddaughter of Y
Explanation / Answer
See, this is a conceptual question. Actually, Dervivation rules are just simply ways to cinstraint thae fact. eg. Grandfather derivation rule stated in the question. Now, lets focus on the asked derivation rules:
Note: Keep in mind F1, F2, F3 and C1, C2 , C3 defined in the question:
(i) X is a father of Y
Di : PersonX is a father of PersonY if
PersonX is MALE and PersonX is a parent PersonY
(j) X is a daughter of Y
Dj : PersonX is a daughter of PersonY if
PersonX is Female and PersonY is a parent PersonX
(k) X is a granddaughter of Y
Dk PersonX is a granddaughter of PersonY if
PersonX is Female and PersonY is a parent of some other PersonZ who is a parent of PersonX
See, its just conceptual.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.