Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1. For each table, identify the primary key and the foreign key(s). If a table does not have a
foreign key, write None in the space provided.
TABLE PRIMARY KEY FOREIGN KEY(S)
2. Do the tables exhibit entity integrity? Answer yes or no and then explain your answer.
3. Do the tables exhibit referential integrity? Answer yes or no and then explain your answer.
Write NA (Not Applicable) if the table does not have a foreign key.
REGION NA
Because REGION_CODE values occur more than once in STORE, we may conclude that each
REGION can contain many stores. But since each STORE is located in only one REGION, the
relationship between STORE and REGION is M:1. (It is, of course, equally true that the relationship
between REGION and STORE is 1:M.)
5. Create the ERD to show the relationship between STORE and REGION. (using different
shapes in MS Word or you may draw one manually and scan to the word doc)
The Crow’s Foot ERD is shown below. Note that each store is located in a single region, but that each
region can have many stores located in it. (It’s always a good time to focus a discussion on the role of
business rules in the creation of a database design.)
6. Describe the type(s) of relationship(s) between EMPLOYEE and STORE. (Hint: Each store
employs many employees, one of whom manages the store.)
There are TWO relationships between STORE and REGION. The first relationship, expressed by
STORE employs EMPLOYEE, is a 1:M relationship, because one store can employ many employees
and each employee is employed by one store. The second relationship, expressed by EMPLOYEE
manages STORE, is a 1:1 relationship, because each store is managed by one employee and an
employee manages only one store.
7. Draw the ERD to show the relationships among EMPLOYEE, STORE, and REGION. (using
different shapes in MS Word or you may draw one manually and scan to the word doc)
The Crow’s Foot ERD is shown in Figure P3.8. Remind students that you always read from the “1”
side to the “M” side in any 1:M relationship, i.e., a STORE employs many EMPLOYEEs and a
REGION contains many STORES. In a 1:1 relationship, you always read from the “parent” entity to
the related entity. In this case, only one EMPLOYEE manages each STORE … and each STORE is
managed by only one EMPLOYEE.
We have shown Visio Professional-generated ERD to include the properties of the manages
relationship. Note that there is no mandatory 1:1 relationship available at this point. That’s why there
is an optional relationship – the O symbol – next to the STORE entity to indicate that an employee is
not necessarily a manager. Let your students know that such optional relationships will be explored in
detail in Chapter 4. (Explain that you can create mandatory 1:1 relationships when you add attributes
to the entity boxes and specify a mandatory data entry for those attributes that are involved in the 1:1
relationship.)
• Full JOIN
o All the rows from the both table are retained with null values in the columns of the
unmatched rows.
o All the rows from the left table are retained with null values in the right table
columns of the unmatched rows.
-- i.e. include all records from STUDENT and only those records from PROFESSOR
where joined fields (PROF_CODE) are equal.
o Resulting table shows that students 100278 and 531268 do not have advisors
assigned to them