0% found this document useful (0 votes)
132 views12 pages

1426357293.3273chapter 2 In-Class Exercises

This document contains scenarios and entity-relationship diagrams (ERDs) as examples for chapter 2 exercises in a database fundamentals textbook. The scenarios describe relationships between entities such as students and activities, employees and projects, courses and prerequisites, courses and sections, and chemists, projects, and equipment. The corresponding ERDs diagram the entities and relationships, including identifying attributes, multi-valued attributes, optional/mandatory participation, and composite attributes.

Uploaded by

Sha Eem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
132 views12 pages

1426357293.3273chapter 2 In-Class Exercises

This document contains scenarios and entity-relationship diagrams (ERDs) as examples for chapter 2 exercises in a database fundamentals textbook. The scenarios describe relationships between entities such as students and activities, employees and projects, courses and prerequisites, courses and sections, and chemists, projects, and equipment. The corresponding ERDs diagram the entities and relationships, including identifying attributes, multi-valued attributes, optional/mandatory participation, and composite attributes.

Uploaded by

Sha Eem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Fundamentals of Database systems

Chapter 2 In Class Exercises

Chapter 2 Exercises

Page 1

Scenario #1
The entity type STUDENT has the following
attributes: student-name, address, hair-color,
phone, age, activity, and number-of-years.
Activity represents some campus-based
student activity, and number-of-years
represents the number of years the student
has engaged in this activity.
A given student may engage in more than one
activity.
Chapter 2 Exercises

Page 2

ERD For Scenario #1


Identifier

Student

Simple attributes

student-name
Multi-valued attribute

address
hair-color
{ phone }
age
{ activity-history ( activity-name, number-of-years ) }

Composite attribute

Chapter 2 Exercises

Page 3

Scenario #2
A company has a number of employees. The attributes of
EMPLOYEE include Emp_ID (identifier), Name, Address, and
Birthdate.
The company also has several projects. Attributes of PROJECT
include Proj_ID (identifier), Proj_Name, and Start_Date.
Each employee may be assigned to one or more projects, or may
not be assigned to any project.
A project must have at least one employee assigned to it, and
may have any number of employees assigned to it.
An employees billing rate may vary by project, and the
company wishes to record the billing rate (Billing_Rate) for
each employee when assigned to a particular project.

Chapter 2 Exercises

Page 4

ERD For Scenario #2


Attribute of the
relationship
billing-rate
Employee

Project

employee-id
emp-name
address
birthdate

Mandatory
participation.
Every project must
have an employee .

project-id
project-name
start-date

Optional
participation.
Not every
employee works on
a project.

Chapter 2 Exercises

Page 5

Scenario #3
A university has a large number of courses in its
catalog.
Attributes of COURSE include Course-number
(identifier), Course-Name, and credit-hours.
Each course may have one or more different courses
as prerequisites, or may have no prerequisites.
Similarly, a particular course may be a prerequisite for
any number of courses, or may not be a prerequisite
for any other course.

Chapter 2 Exercises

Page 6

ERD For Scenario #3

Course
course-number
course-name
credit-hours

is-a prerequisite

Chapter 2 Exercises

has-a prerequisite

Page 7

Scenario #4
A university course may have one or more
scheduled sections, or it may not have a
scheduled section.
Attributes of COURSE include Course_ID
(identifier), Course_Name, and Credit_Hrs.
Attributes
of
SECTION
include
Section_Number
as
identifier
and
Semester_ID. Semester_ID is composed of
two parts: Semester and Year.
Chapter 2 Exercises

Page 8

ERD For Scenario #4


Course

Section
has

course-id
course-name
credit-hours

section-number
semester-id (semester, year)

Chapter 2 Exercises

Page 9

ERD For Scenario #4


Course

Section
has

course-id
course-name
credit-hours

section-number
semester-id (semester, year)

Instructor
instructor-id
instructor-name
office-number
department

Chapter 2 Exercises

teaches

Page 10

Scenario #5
A laboratory has several chemists who work on one or more projects.
Chemists may also use certain kinds of equipment on each project.
Attributes of CHEMIST include Employee_ID (identifier), Name, and
Phone_no.
Attributes of PROJECT include Project_ID (identifier) and Start_Date.
Attributes of EQUIPMENT include Serial_no. and Cost.
The organization wants to record Assign_Date that is, the date when
a give equipment item was assigned to a particular chemist working on
a specified project.
A chemist must be assigned to at least one project and one equipment
item.
A given piece of equipment need not be assigned, and a given project
need not be assigned either a chemist nor a piece of equipment.

Chapter 2 Exercises

Page 11

ERD For Scenario #5


All three entities participate
in an assignment. However,
EQUIPMENT and
PROJECT do not need to
participate in any
assignments. All entities
have multiple assignments.

This relationship was created to show


what projects a chemist works on.

Chapter 2 Exercises

Page 12

You might also like