0% found this document useful (0 votes)
8 views4 pages

Homework3 Instructor Solution

Uploaded by

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

Homework3 Instructor Solution

Uploaded by

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

Instructor’s Suggested Homework #3 Solution

Recap of entities and attributes

STUDENT
Student ID
Last Name
First Name
Middle Name
Date of Birth
Major
Class Level (freshman, sophomore, etc.)
Residence Street
Residence City
Residence State
Residence Zip Code
Residence Phone Number
Secondary Phone Number

Derived attributes (can be determined via queries) – GPA, credits earned

COURSE
Course ID
Course Description
Department
Credits

DEPARTMENT
Department ID
Department Name

INSTRUCTOR
Instructor ID
Title
Last Name
First Name
Department

MAJOR
Major ID
Major Name
Department

1) Relationship sentence pairs


Each STUDENT has a MAJOR.
Each MAJOR is used by one or more STUDENTs.

Each STUDENT is part of one or more ENROLLMENTs.


Each ENROLLMENT involves a STUDENT.

Each COURSE is part of one or more ENROLLMENTs.


Each ENROLLMENT involves a COURSE.

Each DEPARTMENT provides for one or more MAJORs.


Each MAJOR belongs to a DEPARTMENT.

Each INSTRUCTOR is part of one or more ENROLLMENTs.


Each ENROLLMENT involves an INSTRUCTOR.

Each INSTRUCTOR belongs to a DEPARTMENT.


Each DEPARTMENT has one or more INSTRUCTORs.

2) Entity/Relationship Diagrams (ERD)

3) Table specification metadata


In the above metadata below PK is an abbreviation for primary key and FK is an abbreviation for foreign
key. Generic data types of Character, Number, and Date are purposely still used in this phase since the
specific relational database management system (RDBMS) may not have been specified yet, and data
types differ from one product to another.

Table STUDENTS

Key Type(s) Column Name Data Type Size Can be NULL? Description
PK Student_ID Character 10 No Unique Student Identifier
Last_Name Character 30 No Last Name of Student
First_Name Character 20 No First Name of Student
Middle_Name Character 15 Yes Middle Name of Student
DOB Date No Student’s Date of Birth
Major Character 10 No Student’s Major
Class_Level Character 10 Yes Student’s Class (e.g. freshman)
Residence_Street Character 30 No Street Address of Student
Residence_City Character 30 No City of Student’s Residence
Residence_State Character 2 No State of Student’s Residence
Residence_Zip_Code Character 5 No Student’s Zip Code
Residence_Phone Character 12 No Student’s Primary Phone
Secondary_Phone Character 12 Yes Student’s Alternate Phone
FK Major_ID Character 10 No Student’s Major

Table MAJORS

Key Type(s) Column Name Data Type Size Can be NULL? Description
PK Major_ID Character 10 No Unique Major Abbreviation
Major_Name Character 30 No Full Name of the Major
FK Department_ID Character 10 No Reference to DEPARTMENTS

Table DEPARTMENTS

Key Type(s) Column Name Data Type Size Can be NULL? Description
PK Department_ID Character 10 No Unique Dept. Abbreviation
Department_Name Character 30 No Full Name of the Department

Table GRADES

Key Type(s) Column Name Data Type Size Can be NULL? Description
PK Grade Character 2 No Unique Grade (e.g. A-, C+)
Grade_Description Character 30 No Full Description of the Grade
Table INSTRUCTORS

Key Type(s) Column Name Data Type Size Can be NULL? Description
PK Instructor_ID Character 10 No Unique Instructor ID
Title Character 8 No Title of Instructor (e.g. Dr., Ms.)
Last_Name Character 30 No Instructor’s Last Name
First_Name Character 20 No Instructor’s First Name
FK Department_ID Character 10 No Reference to DEPARTMENTS

Table COURSES

Key Type(s) Column Name Data Type Size Can be NULL? Description
PK Course_ID Character 10 No Unique Course ID
Couse_Desciption Character 30 No Description of the Course
FK Department_ID Character 10 No Reference to DEPARTMENTS
Credits Numberic 2, 1 No Number of Credits for Course

Table ENROLLMENTS

Key Type(s) Column Name Data Type Size Can be NULL? Description
PK, FK Course_ID Character 10 No Unique Course ID
PK, FK Student_ID Character 30 No Unique ID of the Course
PK Year Numeric 9 No Year Course Completed
PK Semester Character 12 No Semester in Year Completed
PK, FK Instructor_ID Character 10 No Unique Instructor ID
FK Grade Character 2 Yes Student’s Course Grade

You might also like