You are on page 1of 11

MIT

Assignment 1
ITECH 1006 - Database Management Systems

Student Name(ID)
8/19/2017
Contents
ER Diagram .............................................................................................................................................. 2
Assumptions........................................................................................................................................ 2
Normalization.......................................................................................................................................... 4
Conversion of E-R diagram to relational schema.................................................................................... 6
Reference: ............................................................................................................................................. 10

1
ER Diagram

Assumptions:
One employee reports only one supervisor
One employee can have only one permanent address
One employee can be associated with multiple courses
One employee works with one employee role
One course category can have a pre-request course category
One course has only one course category
One course can be supervised by one employee

2
One student can have only one permanent address
One student can belong to multiple courses
One student can have multiple account
One account belongs to one bank.
One account has only one account type.
One student has only one payment method
One student can make multiple payments depending on his payment method choice.
One course can have multiple lectures.
One course lecture can be taken by only one employee (staff).
One course lecture has only one room associated with it.
Teacher of the associated lecture can take multiple notes of the lecture.
Teacher of the lecture mark attendance of the multiple students present in the lecture
along with their performance on the lecture.
One lecture has only one attendance per student.
One student can receive multiple awards for one course.

3
Normalization
ROLE (RoleID, Role)

LOCATION (LocationID, City, State, Country, PinCode)

EMPLOYEE (EmployeeID, LastName, FirstName, PhoneNumber, Street, LocationID,


TaxNumber, RoleID, WeeklyPayScale)

COURSE_CATEGORY (CourseCategoryID, CourseName, TotalLecture, Description,


AllowedStudentCount, PreRequestCourseCategoryID)

COURSE (CourseID, CourseCategoryID, SupervisingEmployeeID, StartDate, EndDate, Fee)

PAYMENT_METHOD (PaymentMethodID, Method)

STUDENT (StudentID, FirstName, LastName, PhoneNumber, LocationID, Email, DOB

, SpecialRequirements, EmergencyContact, EmergencyContactPersonName, DOJ, DOL,


PaymentMethodID)

STUDENT_COURSES (StudentID, CourseID, StartDate, DailyClassCount)

STUDENT_ACCOUNT_DETAILS (AccountDetailId, StudentID, BankID, AccountTypeId,


AccountNumber, AccountName)

STUDENT_COURSE_PAYMENTS (PaymentId, StudentID, PaymentMethodID,


AccountDetailId, Payment_mode, NumberOfDaysOnPass, PaymentStatus)

4
ACCOUNT_TYPE (AccountTypeId, Type)

BANK (BankID, Name)

ROOM (RoomID, Abbrevation)

COURSE_LECTURE_DETAIL (CourseLectureID, RoomID, EmployeeID, StartDateTime,


EndDateTime, CourseID )

AWARD (AwardID, Title)

STUDENT_AWARD (StudentAwardID, AwardID, StudentID, DateAwarded, SpecialNotes,


CourseID)

ATTENDANCE (AttendanceID, CourseLectureID, StudentID, IsPresent, Details)

NOTE (NoteID,LectureID, AddedDate, Subject, Description)

All the relations above are in 3NF.

5
Conversion of E-R diagram to relational schema
Table Field Type Description
EMPLOYEE EmployeeID INT Primary Key
FirstName VARCHAR(40)
LastName VARCHAR(40)
PhoneNumber VARCHAR(10)
Street VARCHAR(40)
LocationID INT Foreign Key Reference to
LOCATION (LocationID)
TaxNumber VARCHAR(20)
RoleID INT Foreign Key Reference to
ROLE (RoleID)
WeeklyPayScale FLOAT(5,2)
ROLE RoleID INT Primary Key
Role VARCHAR(25)
LOCATION LocationID INT Primary Key
City VARCHAR(40)
State VARCHAR(40)
Country VARCHAR(40)
PinCode VARCHAR(6)
NOTE NoteID INT Primary Key
LectureID INT Foreign Key Reference to
COURSE_LECTURE_D
ETAIL(CourseLectureID)
AddedDate Date
Subject VARCHAR(100)
Description TEXT
COURSE_CATEG CourseCategoryID INT Primary Key
ORY CourseName VARCHAR(100)
TotalLecture INT
Description TEXT
AllowedStudentCount INT

6
PreRequestCourseCategoryID INT Foreign Key Reference to
COURSE_CATEGORY
(CourseCategoryID)
COURSE CourseID INT Primary Key
CourseCategoryID INT Foreign Key Reference to
COURSE_CATEGORY
(CourseCategoryID)
SupervisingEmployeeID INT Foreign Key Reference to
EMPLOYEE
(EmployeeID)
StartDate Date
EndDate Date
Fee FLOAT(5,2)
PAYMENT_MET PaymentMethodID INT Primary Key
HOD Method VARCHAR(10)
STUDENT StudentID INT Primary Key
FirstName VARCHAR(40)
LastName VARCHAR(40)
PhoneNumber VARCHAR(10)
Street VARCHAR(40)
LocationID INT Foreign Key Reference to
LOCATION (LocationID)
Email VARCHAR(50)
DOB Date
SpecialRequirements VARCHAR(200)
EmergencyContact VARCHAR(10)
EmergencyContactPersonNam VARCHAR(40)
e
DOJ Date
DOL Date
PaymentMethodID INT Foreign Key Reference to
PAYMENT_METHOD
(PaymentMethodID)

7
STUDENT_ACC AccountDetailId INT Primary Key
OUNT_DETAILS StudentID INT Foreign Key Reference to
STUDENT (StudentID)
BankID INT Foreign Key Reference to
BANK (BankID)
AccountTypeId INT Foreign Key Reference to
ACCOUNT_TYPE
(AccountTypeId)
AccountNumber VARCHAR(20)
AccountName VARCHAR(100)
ACCOUNT_TYP AccountTypeId INT Primary Key
E Type VARCHAR(10)
BANK BankID INT Primary Key
Name VARCHAR(100)
STUDENT_COU StudentID INT Primary Key, Foreign Key
RSES Reference to STUDENT
(StudentID)
CourseID INT Primary Key, Foreign Key
Reference to COURSE
(CourseID)
StartDate Date
DailyClassCount INT
ROOM RoomID INT Primary Key
Abbrevation VARCHAR(50)
COURSE_LECTU CourseLectureID INT Primary Key
RE_DETAIL RoomID INT Foreign Key Reference to
ROOM (RoomID)
EmployeeID INT Foreign Key Reference to
EMPLOYEE
(EmployeeID)
StartDateTime DATETIME
EndDateTime DATETIME
CourseID INT Foreign Key Reference to

8
COURSE (CourseID)
ATTENDANCE AttendanceID INT Primary Key
CourseLectureID INT Foreign Key Reference to
COURSE_LECTURE_D
ETAIL(CourseLectureID)
StudentID INT Foreign Key Reference to
STUDENT (StudentID)
IsPresent TINYINT
Details TEXT
AWARD AwardID INT Primary Key
Title VARCHAR(50)
STUDENT_AWA StudentAwardID INT Primary Key
RD AwardID INT Foreign Key Reference to
AWARD (AwardID)
StudentID INT Foreign Key Reference to
STUDENT (StudentID)
DateAwarded Date
SpecialNotes TEXT
CourseID INT Foreign Key Reference to
COURSE (CourseID)
STUDENT_COU Primary Key
PaymentId INT
RSE_PAYMENTS Foreign Key Reference to
STUDENT (StudentID)
StudentID INT
Foreign Key Reference to
PAYMENT METHOD
(PaymentMethodID)
PaymentMethodID INT
Foreign Key Reference to
STUDENT_ACCOUNT_
DETAILS
(AccountDetailId)
AccountDetailId INT
Payment_mode VARCHAR
NumberOfDaysOnPass INT
PaymentStatus TINYINT

9
Reference:
Draper, J. (1982). A functional specification of the relational DBMS. Washington, DC: The
Bureau.

Pallaw, V. (2010). Database management systems. Darya Ganj, New Delhi: Asian Books
Private Ltd.

10

You might also like