Preview

01 - Data Models and ERDs

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

  TRUE

  FALSE

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

  entity

  erudite

  enfield

  elephant

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

  files /folders

  attributes / fields

  methods /events

  tables / columns

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

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

  Members, E-Books, Subscription

  E-Book column and E-Book row

  Subscription ID, Subscription name

 5. Links between entities are also called:

  relationships

  queries

  reports

  integrities

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

  multiple to field

  field to field

  many to many

  zero to zero

 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

  one to many relationship

  many to zero 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.

  FALSE

  TRUE

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

  FALSE

  TRUE

 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.

  FALSE

  TRUE

 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

  many to many relationship

  one to one relationship

  many to zero relationship

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

  Neither Solution 1 or 2

  Both Solution 1 and Solution 2

  Solution 2

  Solution 1

 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.

  main

  foriegn

  field

  first

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

  field creation

  meddling

  integrity relationship

  modelling

 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?
student_classes.png

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

  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

  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.

  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.

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

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

  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

  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

 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

  TRUE

  FALSE

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

  TRUE

  FALSE

 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.

Entities: 
=========
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.

Relationships: 
===============
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.

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

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

  FALSE

  TRUE