01 - Data Models and ERDs

 1. A database contains one or more related tables. Each table holds all of the information



 2. An _______ is a person, place, thing or concept about which data can be collected. Examples include EMPLOYEE, HOUSE, CAR





 3. Entities will be made up of __________ that represent that entity. An example of _________ for the entity 'Customer' would be ID, First Name etc.

  tables / columns

  files /folders

  attributes / fields

  methods /events

 4. Taking the example of an online subscription site (to purchase e-books), possible entities could be:

  Subscription ID, Subscription name

  Members, E-Books, Subscription

  E-Book ID, E-Book Title, E-Book name

  E-Book column and E-Book row

 5. Links between entities are also called:





 6. There are different types of relationships including: one to one, one to many and ______________________

  zero to zero

  field to field

  multiple to field

  many to many

 7. Assuming a world in which a husband can only have one wife (and vice versa), this would be an example of a:

  one to one relationship

  many to zero relationship

  one to many relationship

  many to many relationship

 8. An example of a one to many relationship could be Father to children. A child can have only one father. A father can have many children.



 9. A many to many relationship is an excellent idea when designing tables, because it allows for greater flexibility.



 10. It is much preferred to find a way to change a many to many relationship to a many to one or one to many relationship instead.



 11. What type of relationship is being modelled in this example?
Customers can take out subscriptions to many E-Books
Many E-books can be taken out by many Customers

  one to many relationship

  one to one relationship

  many to zero relationship

  many to many relationship

 12. To solve the 'many to many' problem with Customers and E-books, which of the following solutions could be used?

  Both Solution 1 and Solution 2

  Solution 2

  Solution 1

  Neither Solution 1 or 2

 13. When designing relationships it is helpful to remember that: the 'many' side is usually the ______ key. The 'one' side is usually the primary key.





 14. Before setting up a database, working out the entity relationships, attributes and entities themselves is called:

  integrity relationship


  field creation


 15. Almost always, a Many-to-Many relationship conceals a _____________. For this reason, identifying and adding the _________________ to the model eliminates Many-to-Many relationships

  hidden entity

  duplicate column or row heading

  erroneous field

  duplicate primary key

 16. Read the following excerpt that describes a particular scenario. How would you solve the problem?
Suppose you have a list of students and a 
list of classes. There’s a many-to-many 
relationship between the students and their
classes, since each student can take multiple
classes, and each class can have multiple
students enrolled. So far you have a
table of students and a table of classes,
that are linked together. 

But now you want to store information 
about each student’s grade in the class. 
Do you put this information in the table of 
students, or in the table of classes?

  You would ideally put the information in the table of students as the information is directly linked to that entity

  You would ideally make a new link or join table (e.g. Grades) which has a field linked to students and a field linked to classes.

  You would create two new tables. One for Students and another for Classes. These would be copies of the original tables and linked to two tables for Grades.

  The ideal solution would be to put this information in the classes table. The class would store grades for that class, as it is not related directly to student

 17. What is the join/link table in this example and which of the following answers best describes its purpose?

  In this example the 'Interviewers' table should be the join table. It is the intermediary between the other two tables

  The interview table. It can be thought of as the relationship between an applicant and an interviewer, and is needed to store information about each interview

  There is no link or join table shown in this example

  In this example the 'Applicants' table should be the join table. It contains shared fields that exist in the other two tables

 18. It is usually (but not always) the case that the following is true:
The 'Many' side is usually the foreign key
The 'One' side is usually the primary key



 19. The process of working out the entities, attributes and the entity relationships is called: attribute modelling



 20. ER diagrams are used to analyze existing databases to find and resolve problems in logic or deployment. Drawing the diagram should reveal where it’s going wrong.
How to draw a basic ER diagram

Purpose and scope: 
Define the purpose and scope of what you’re analyzing or modeling.

Identify the entities that are involved. When you’re ready,
start drawing them in rectangles (or your system’s choice of shape) 
and labeling them as nouns.

Determine how the entities are all related. 
Draw lines between them to signify the relationships and label them. 
Some entities may not be related, and that’s fine. In different notation systems,
 the relationship could be labeled in a diamond, another rectangle or
 directly on top of the connecting line.

Layer in more detail by adding key attributes of entities. Attributes 
are often shown as ovals. 

Show whether the relationship is 1-1, 1-many or many-to-many.