|
|
|
|
Database Design
eXercise #1
Introduction to Information Science
- A Stipulation involves specifying a naming convention ans an instruction
indicates some sort of action to be performed with a fact, classify
each of the following sentences according to whether they represent
propositions, instructions, stipulations or queries.
For any that represent propositions, indicate whether they are atomic
(or single valued).
- Add the fact that William lives in Maryborough
- Where does William live.
- Let a person be denoted by the letter 'p'.
- William lives in Maryborough.
- This table has headings 'person' and 'Subject'.
- Sandra studies French and German.
- John doesn't study Graphics.
- This is an instruction.
- Choosing suitable identifiers for predicates (or roles),
entities and label types, cast each of the following sentences in
deep sentence structure form using the format:
predicate(entity-category label-type label-instance,
entity-category label-type label-instance)
example: eats(Person FirstName 'Fred', Food FoodName 'Tripe')
- Fred lives in Springwood.
- Goodna is a suburb of Brisbane
- Mavis is a citizen of Australia
- Douglas Adams wrote both 'The Meaning of Liff' and 'The Hitch
Hikers Guide to the Galaxy'
- William Shatner played Captian 'James Tiberius Kirk'
- Fred is brother to Lucy
-
We may indicate permissible transitions between various states with
diagrams. Suppose we have just 4 states denoted by 'a', 'b', 'c' and
'd'. At left the possible transitions between states is indicated
and a Transition diagram is drawn beside, using circled states linked
by allowable transition arrows.
Draw transition diagrams for the following situations:
- Each year has 4 seasons: Summer, Winter, Autumn and Spring.
- A swinging pendulum may be in 4 states, two of which are stationary,
one moving left the other moving right
- A swinging pendulum may be in one of three distinct states:
stationary, speeding up or slowing down
- matter can be in 3 states: solid, liquid and gas
- a process can be in 4 states: waiting to be processed, being
processed, temporarily suspended and completed
- A person may have one of 5 marital states: married, single,
divorced, separated and widowed
- People are either not enrolled in a high school, currently enrolled,
or previously enrolled. If they are currently enrolled, they are
enrolled in exactly one year level 8 through 12. Students may
enter at any year level, repeat any year level, be promoted only
one year level at a time but not demoted.
- Consider the following Universe description (conceptual schema):
Stored Fact Types:
- F1: Person owns CarType
- F2: Person has Age
- F3: Person drives CarType
Constraints:
- C1: Each person has exactly one age recorded (ie. at least one
and at most one)
- C2: Each person owns at most one car
- C3: X drives CarType IF X owns CarType AND Age >=17
Derivation Rules:
- D1: Count(owns X) returns the # of owners of CarType X
- D2: Avg (Age) gives the average age
- D3: X holdsLicence IF X drives
Your job is to decide (by starting with an initially EMPTY information
base), what the cumulative effect of each of the following transactions
are. For each transaction, suggest the CIP response, and indicate
the current state of the information base (ie. where the data is
stored and what the fact tables look like).
- Add: Person 'Chris' has Age 17.
- Add: Person 'Sally' owns CarType 'Ferrari'.
- Add: Person 'Chris' owns CarType 'Range Rover'.
- Add: Person 'Sally' has Age 15.
- Add: Person 'Sally' owns CarType 'Ferrari'.
- Add: Person 'Cassy' owns MotorBike 'Harley Davidson'.
- Add: Person 'Travis' has Age 14.
- Add: Person 'Travis' drives CarType 'Mini'
- Add: Person 'Sally' owns CarType 'BMW'
- Add: Person 'Sally' has Age 15
- Add: [ Del:Person 'Sally' has Age 15 Add:Person 'Sally' has
Age 17]
- Add: Person 'Jan' has Age 20
- Add: Person 'Jan' drives CarType 'BMW'
- Avg (Age) ?
- What type of car does Person 'Chris' drive?
- What type of car does Person 'Sally' own?
- What does Person 'Chris' drive?
- Consider the following Universe description (conceptual schema):
Stored Fact Types:
- F1: Student isEnrolledIn Course
- F2: Student has EnrollmentStatus
Constraints:
- C1: Each Student is enrolled in exactly one course
- C2: Each Student has at most one enrolment status
- C3: Only the following enrolment states are permitted: active,
deferred, suspended, graduated
- C4: Only the following enrolment transitions are allowed:
From/To |
Active |
Deferred |
Supspended |
Graduated |
Active |
0 |
0 |
1 |
1 |
Deferred |
1 |
0 |
0 |
0 |
Suspended |
1 |
0 |
0 |
0 |
Graduated |
0 |
0 |
0 |
1 |
('1' indicates allowed)
Derivation Rules:
- D1: Count(isEnrolledIn X) returns the number of students enrolled
in course X
Your job is to decide (by starting with an initially EMPTY information
base), what the cumulative effect of each of the following transactions
are. For each transaction, suggest the CIP response, and indicate
the current state of the information base.
- Add: Student 'Sarah' isEnrolledIn Course 'Science'
- Add: Student 'Sam' has EnrollmentStatus 'Active'
- Add: Student 'Sam' isEnrolledIn Course 'Arts'
- Add: Student 'Sue' has EnrollmentStatus 'Deferred'
- Add: [ Add: Student 'Sam' has EnrollmentStatus 'Deferred' Del:
Student 'Sam' has EnrollmentStatus 'Active' ]
- Add: Student 'Fred' isEnrolledIn Course 'English'
- Add: Student 'Sarah' isEnrolledIn Course 'English'
- What is Student 'Sam''s' EnrollmentStatus ?
- Add: Student 'Sally' isEnrolledIn Subject 'Latin'
- Add: Student 'Fred' has EnrollmentStatus 'Active'
- Add: Student 'Sarah' has EnrollmentStatus 'Active'
- Add: Student 'Sarah' has EnrollmentStatus 'Deferred'
- Add: Student 'Sam' has EnrollmentStatus 'Suspended'
- What are the possible EnrollmentStatuses?
- Add: Student 'Simon' isEnrolledIn Course 'Science'
- Add: Count('Science')
- Who is enrolled in Subject 'English'?
Solutions
|
|
|
|
|
|
|