0% found this document useful (0 votes)
8 views

Second Assignment on Data Modeling 15

Uploaded by

mulay berihu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Second Assignment on Data Modeling 15

Uploaded by

mulay berihu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Second Assignment on Data Modeling 15%

1. Normalize the above table and show it when the table is at each normal form
2. Draw ERD (use chen notation)
3. Prepare the schema of proposed database
4. Write the SQL code

Student Table
studentId
Fname
Lname
Age
CourseNo
Grade
Faculty
Faculty Head
Department Name
Departmen Head
DepartmentID
Istructor
StudentCourse
InstructorCourse
Department

[Student] -- enrolls --> [Course]

[Course] -- taught by --> [Instructor]

[Instructor] -- belongs to --> [Faculty]

[Department] -- manages --> [Faculty]

2NF Tables:

Student Table

- studentId (PK)

- Fname

- Lname

- Age

Course Table

- CourseNo (PK)

- Grade

- Instructor

- StudentCourse

- InstructorCourse
Faculty Table

- Faculty (PK)

- Faculty Head

Department Table

- DepartmentID (PK)

- Department Name

- Department Head

CREATE TABLE Student (

studentId INT PRIMARY KEY,

Fname VARCHAR(50),

Lname VARCHAR(50),

Age INT,

DepartmentID INT,

FOREIGN KEY (DepartmentID) REFERENCES Department(DepartmentID)

);

CREATE TABLE Course (

CourseNo INT PRIMARY KEY,

Grade CHAR(2),

InstructorID INT,

FOREIGN KEY (InstructorID) REFERENCES Instructor(InstructorID)

);

CREATE TABLE Faculty (

FacultyID INT PRIMARY KEY,

FacultyName VARCHAR(50),

FacultyHead VARCHAR(50)

);

CREATE TABLE Department (

DepartmentID INT PRIMARY KEY,

DepartmentName VARCHAR(50),
DepartmentHead VARCHAR(50)

);

CREATE TABLE Instructor (

InstructorID INT PRIMARY KEY,

InstructorName VARCHAR(50)

);

You might also like