Advanced Modeling Topics
Mapping the ER Model
1. Data Modelers need to look for similarities and patterns. Why?
A:The Main reason is that it saves time. .It makes you feel more confident that you know the situation. It will help you ask the right question.It will halp you find the real complwx things and will prevent you from making the same mistake.
2. What is the name of the common pattern that models “an entity A is divided into many Bs”?
A:The first common structure is the Master detail. “Master A is divided into Detail Bs”.
a. What are some characteristics of this structure?
A: The Details never exist on their own – they always exist in the context of the Master. The relationship between the Master and the Detail is usually non-transferable.
b. Why is incorporating non-transferability important in this structure?
A:Each can indepently exist on their own.
c. List some common relationship names that would be typical for this structure.
A:It can be recognized from relationship names such as :Consist of,Divided into, Made of and exists with.
3. List two special cases of the Master-Detail pattern.
A:The first one is Basket and it allows for the detail to be of different type.
The other one is Master Detail special case pattern is the classification.
4. What are some differences in the Classification pattern from the typical Master-Detail pattern?
Master Detail: the details never exist on their own-the always exist in the context of the Master.The realationship between the Master and the detail is usually non-transferable.
A: A good example is the shopping cartanalogy. Your shopping cart (order) consists of many items, and each of those items is adifferent type. For instance, your shopping cart may have lettuce and other food items, analarm clock, and a printer cartridge The lettuce would be grocery type, the clock- household type, and the printer cartridge-Office Supplies type. An exclusive arc models that a given item can only be one type.The other Master-Detail special case pattern is the “Classification”. An example is aDepartment classifies many Employees and Employees are classified by their Department.There is no non-transferability in this case. Employees and Departments can exist independently (although we assume that employees will eventually be assigned to a department) and can change (employees can change departments).
5. A Mother-Child pattern is another name for what pattern?
6. There are two general cases in the Hierarchy pattern: known # of levels, and no known level limit. What are the two implementations of these cases?
A: If the levels of the hierarchy are known and not many, let’s say 5 or less, then a classic 1:M relationship structure can be used. However, if the levels of the hierarchy are
not know, or are many, then a 1:M recursive structure is often used. A word of caution
when using recursive structures: all levels of the hierarchy must have the same
attributes, the relationship must be optional at both ends (so you can define a start and
stop point), and recursion brings many more constraints during implementation.
There are two special cases of the hierarchy: the Chain, and the Network. The Chain is a
1:1 relationship where sequence is important. The Network is a recursive M:M relationship.
7. When would you choose to model with a series of 1:M relationships vs. a recursive relationship?
A:When we have a many entities involved in a model also since 1:m is very common in the ER design we would choose 1:M relationship than recursive relationship.
8. Why do both ends of a recursive relationship that models a hierarchy need to be optional?
A:As the hierarchy must start and end somewere.
9. Why is constraint maintenance more costly with recursive relationships?
A:As many entities and assumptions are involved in the constraints, so their maintenance is more costly than recursive relationships.
10. There are two special kinds of hierarchies. What are they?
A:Chain and the Network
11. Which special kind of hierarchy pays special attention to sequence?
12. What kind of recursive relationship is modeled?
A: • The structure has no known level limit.
• The structure has a level limit, but the limit is high, say six or more.
• An instance of the structure can easily have a change of position, thus changing its
• You like maintaining constraints
13. The Bill of Material model is an example of what special hierarchy structure?
A:It is network Hierarchy structure.
14. When might you consider modeling roles?
A: Roles often occur when a system needs to know more about people than the basic
Name/Address/City information. Modeling the roles as separate entities offers the
possibility to show which attributes are mandatory for a particular role, and, if
necessary, to show relationships between the various roles.
15. When might you consider making your model generic?
A:when you have all the data with you and in future you wil not be adding any new things.
16. The goal of INITIAL database design is to take our conceptual ER model and documentation and create a ‘first cut’ ________.
A:Define table needed in our database.
17. Relational databases are made up of 2 dimensional _______.
18. What is a Primary Key in a table? What is it called if it is made up of more than one column?
A:A primary key is that uniquely identifies wach row in a table.
A primary key having more than one column is called as a composite primary key
19. True or False. Primary Key columns must be NOT NULL.
20. What is a Foreign Key? What is another name for this type of constraint?
A:A foreign key is a column in one that table refers to a primary key in the same or another table. Another name of this constraint is optional composed foreign keys.
21. List 2 kinds of Column Integrity constraints.
A:Column check constraints, Column referential constraints.
22. Give an example of a User-Defined constraint.
A:An exempt employee is not paid f or the first 5 hour of overtime he worked
An employee is the finance department can’t have a tittle of: “Programmer”
A salesman commission can’t exceed 50% of his salary.
23. What tool (type of chart) do we use to document our database design?
A:Table Instance chart
24. List the 6 steps to produce an initial database design.
A: 1 Map the simple entities to tables.
2 Map attributes to columns and document sample data.
3 Map unique identifiers to primary keys.
4 Map relationships to foreign keys.
5 Choose arc options.
6 Choose subtype options.
25. Entities map to ______. What is a simple entity?
A:Table. Simple entity consists of table name,columns,attributes,than can mapped to the table.
26. Attributes map to ________. How do we deal with mandatory attributes?
A: Column.Mandatory Attr ibutes are kept NOT NULL(NN).
27. Why should you include a couple rows of sample data in each table’s Table Instance Chart?
A: To document each relational table on table instance chart.
28. UIDs map to ________. How do you handle UID bars?
A:Pri mary keys. UID bar is designated at the entity. The other is named as secondary UID and not shown in the data model.
29. How do you map M:1 relationships? What if the M side of the relationship is mandatory?
A:For M:1 relationships, take the PK at the one end and put it in the table at the many end
30. How do you map a mandatory 1:1 relationship?
A:For a Mandatory 1:1 relationship, place the unique FK in the table at the mandatory end and use the NOT NULL constraint to enforce the mandatory condition.
31. How do you map an optional 1:1 relationship?
A:If a 1:1 relationship is optional in both directions, place the FK in the table at either end of the relationship.
32. How do you map a 1:M recursive relationship? Is it handled really any differently than a ‘standard’ 1:M relationship?
A:For a 1:M recursive relationship, add a FK column to the single table. This FK column will refer to values of the PK coloumn
33. How do you map a 1:1 recursive relationship?
A:For a 1:1 recursive relationship,add a unique FK to the table. This FK column will refer to values of the PK column.
CIS164AG Data Modeling and Relational Database Design Page 1 of 3