You are on page 1of 55

ER (Entity-Relationship

Model)

1
Answer to Exercise 3.16

The university keeps track of each student's


name, student number, social security number,
current address and phone, permanent address
and phone, birthdate, sex, class (freshman,
sophomore, ..., graduate), major department,
minor department (if any), and degree program
(B.A., B.S., ..., Ph.D.). Some user applications
need to refer to the city, state, and zip of the
student's permanent address, and to the
student's last name. Both social security number
and student number have unique values for each
student.

2
Answer to Exercise 3.16

Lowercase letters

current permanent
current permanent birthdate
phone phone
address address sex
Social class
security
number major
department
Student STUDENT minor
number
department

name
degree program

UPPERCASE LETTERS

3
Answer to Exercise 3.16

DEPARTMENT

DEP_COU

UPPERCASE LETTERS
N

COURSE

4
Answer to Exercise 3.16

Requirements ER schema ER Diagram

5
Answer to Exercise 3.16

Requirements ER schema

6
Answer to Exercise 3.16

1. The university keeps track of each student's


name, student number, social security number,
current address and phone, permanent address
and phone, birthdate, sex, class (freshman,
sophomore, ..., graduate), major department,
minor department (if any), and degree program

7
Answer to Exercise 3.16

1. The university keeps track of each student's


name, student number, social security number,
current address and phone, permanent address
and phone, birthdate, sex, class (freshman,
sophomore, ..., graduate), major department,
minor department (if any), and degree program
current permanent
current permanent birthdate
phone phone
address address sex
Social class
security
number major
department
Student STUDENT minor
number
department

name
degree program
8
Answer to Exercise 3.16

…Some user applications need to refer to the city,


state, and zip of the student's permanent
address, and to the student's last name. Both
social security number and student number have
unique values for each student.

current permanent
current permanent birthdate
phone phone
address address sex
Social class
security
number major
department
Student STUDENT minor
number
department

name
degree program
9
Answer to Exercise 3.16

Some user applications need to refer to the city,


state, and zip of the student's permanent
address, and to the student's last name. Both
social security number and student number have
unique values for each student.
city state zip

current permanent
current permanent birthdate
phone phone
address address sex
Social class
security
number major
department
Lname Student STUDENT minor
number
department
Minit
name
Fname degree program
10
Answer to Exercise 3.16

Some user applications need to refer to the city,


state, and zip of the student's permanent
address, and to the student's last name. Both
social security number and student number have
unique values for each student.
city state zip

current permanent
current permanent birthdate
phone phone
address address sex
Social class
security
number major
department
Lname Student STUDENT minor
number
department
Minit
name
Fname degree program
11
Answer to Exercise 3.16

2. Each department is described by a


name, department code, office number,
office phone, and college. Both name and
code have unique values for each
department.

12
Answer to Exercise 3.16

2. Each department is described by a


name, department code, office number,
office phone, and college. Both name and
code have unique values for each
department.

Department Office Office


Department code number phone College
name

DEPARTMENT

13
Answer to Exercise 3.16

2. Each department is described by a


name, department code, office number,
office phone, and college. Both name and
code have unique values for each
department.

Department Office Office


Department code number phone College
name

DEPARTMENT

14
Answer to Exercise 3.16

3. Each course has a course name,


description, course number, number of
semester hours, level, and offering
department. The value of course number
is unique for each course.

15
Answer to Exercise 3.16

3. Each course has a course name,


description, course number, number of
semester hours, level, and offering
department. The value of course number
is unique for each course.

Course Number of
Course semester
Description number Level Offering
name hours department

COURSE

16
Answer to Exercise 3.16

3. Each course has a course name,


description, course number, number of
semester hours, level, and offering
department. The value of course number
is unique for each course.

Course Number of
Course Semester
Description number Level Offering
name hours department

COURSE

17
Answer to Exercise 3.16

4. Each section has an instructor, semester,


year, course, and section number. The
section number distinguishes different
sections of the same course that are taught
during the same semester/year; its values
are 1, 2, 3, ...; up to the number of sections
taught during each semester.

18
Answer to Exercise 3.16

4. Each section has an instructor, semester,


year, course, and section number. The
section number distinguishes different
sections of the same course that are taught
during the same semester/year; its values
are 1, 2, 3, ...; up to the number of sections
taught during each semester.

Section
Instructor Semester Year Course
number

SECTION
19
Answer to Exercise 3.16

Section
Year Semester
number

Partial key

Instructor Course

SECTION
20
Answer to Exercise 3.16

Section
Year Semester
number

Partial key

Instructor Course

SECTION
21
Answer to Exercise 3.16

5. A grade report has a student, section,


letter grade, and numeric grade (0, 1, 2,
3,4 for F, D, C, B, A, respectively).

22
Answer to Exercise 3.16

5. A grade report has a student, section,


letter grade, and numeric grade (0, 1, 2,
3,4 for F, D, C, B, A, respectively).

Letter Number
Student Section grade
grade

GRADE

23
Answer to Exercise 3.16

5. A grade report has a student, section,


letter grade, and numeric grade (0, 1, 2,
3,4 for F, D, C, B, A, respectively).

Letter Number
Student Section grade
grade

GRADE

24
Answer to Exercise 3.16

Requirements ER schema ER Diagram

25
STUDENT

city state zip

current permanent
current permanent birthdate
phone phone
address address sex
Social class
security
number major
department
Lname Student STUDENT minor
number
department
Minit
name
Fname degree program

SECTION

DEPARTMENT COURSE GRADE 26


STUDENT

Social
security
number major
department
Student STUDENT minor
number
department

SECTION

27
DEPARTMENT COURSE GRADE
STUDENT

major
department
STUDENT DEPARTMENT
minor
department

28
SECTION COURSE GRADE
STUDENT

MAJOR

STUDENT DEPARTMENT

N 1

29
STUDENT

N MAJOR 1
STUDENT DEPARTMENT

30
STUDENT

STUDENT DEPARTMENT
MINOR

M N

31
STUDENT

STUDENT DEPARTMENT
MINOR
M N

32
STUDENT

N MAJOR 1
STUDENT DEPARTMENT
MINOR
M N

OK.

33
DEPARTMENT

department office office


department code number phone college
name

DEPARTMENT

STUDENT

SECTION COURSE GRADE 34


DEPARTMENT

department
department code
name

DEPARTMENT

STUDENT

SECTION COURSE GRADE 35


DEPARTMENT

DEPARTMENT

OK.

36
COURSE

course course number of


description number semester hours level offering
name
department

COURSE

STUDENT

SECTION DEPARTMENT GRADE 37


COURSE

course
number offering
department

COURSE

STUDENT

SECTION DEPARTMENT GRADE 38


COURSE

DEPARTMENT

offering
department

COURSE

SECTION STUDENT GRADE 39


COURSE

1
DEPARTMENT

DEP_COU

N COURSE

40
COURSE

DEPARTMENT

DEP_COU

COURSE

OK.

41
SECTION

semester Section
year
number

instructor partial key course

SECTION

DEPARTMENT

COURSE STUDENT GRADE 42


SECTION

partial key course

SECTION

DEPARTMENT

COURSE STUDENT GRADE 43


SECTION

COURSE

course

SECTION

DEPARTMENT STUDENT GRADE 44


SECTION

1 COURSE

COU_SEL

N SECTION

45
SECTION

COURSE

COU_SEL

SECTION

OK.

46
GRADE

letter number
student section grade
grade

GRADE

SECTION

DEPARTMENT STUDENT COURSE 47


GRADE

letter number
student section grade
grade

GRADE

SECTION

DEPARTMENT STUDENT COURSE 48


GRADE

STUDENT

student

GRADE section SECTION

DEPARTMENT COURSE 49
GRADE

STUDENT

GRADE STU_SEC_GR SECTION

50
GRADE

STUDENT

A B

N N
GRADE STU_SEC_GR SECTION

51
GRADE

STUDENT

A B

N N
GRADE STU_SEC_GR SECTION

OK.

52
GRADE
N MAJOR
1
STUDENT DEPARTMENT
MINOR 1
M N
DEP_COU

COURSE
N
1

COU_SEL

N
N N
GRADE STU_SEC_GR SECTION 53
Answer to Exercise 3.19

(1) The database represents each AIRPORT, keeping its


unique AirportCode, the AIRPORT Name, and the City and
State in which the AIRPORT is located.
(2) Each airline FLIGHT has a unique number, the Airline for
the FLIGHT, and the Weekdays on which the FLIGHT is
scheduled (for example, every day of the week except
Sunday can be coded as X7).
(3) A FLIGHT is composed of one or more FLIGHT LEGs (for
example, flight number CO1223 from New York to Los
Angeles may have two FLIGHT LEGs: leg 1 from New York
to Houston and leg 2 from Houston to Los Angeles). Each
FLIGHT LEG has a DEPARTURE AIRPORT and Scheduled
Departure Time, and an ARRIVAL AIRPORT and Scheduled
Arrival Time.
54
Answer to Exercise 3.19
(4) A LEG INSTANCE is an instance of a FLIGHT LEG on a
specific Date (for example, CO1223 leg 1 on July 30, 1989). The
actual Departure and Arrival AIRPORTs and Times are
recorded for each flight leg after the flight leg has been
concluded. The Number of available seats and the AIRPLANE
used in the LEG INSTANCE are also kept.
(5) The customer RESERVATIONs on each LEG INSTANCE
include the Customer Name, Phone, and Seat Number(s) for
each reservation.
(6) Information on AIRPLANEs and AIRPLANE TYPEs are also
kept. For each AIRPLANE TYPE (for example, DC-10), the
TypeName, manufacturing Company, and Maximum Number of
Seats are kept. The AIRPORTs in which planes of this type
CAN LAND are kept in the database. For each AIRPLANE, the
AirplaneId, Total number of seats, and TYPE are kept.
55

You might also like