Skip to content

Instantly share code, notes, and snippets.

@f4ww4z
Last active November 19, 2019 05:38
Show Gist options
  • Save f4ww4z/7c3c9729323b62fa32c89280c5458f22 to your computer and use it in GitHub Desktop.
Save f4ww4z/7c3c9729323b62fa32c89280c5458f22 to your computer and use it in GitHub Desktop.
For Database Quiz

Normalization Quiz (19/11/2019)

Name: Maharaj Faawwaz A Yusran

Matrix No: S52500

Question 1

Functional dependencies I see:

Table 1

Attribute Determines
SID CID, S_name, Grade, Faculty
CID C_name
Faculty F_phone

Table 2

Attribute Determines
OID O_Date, CID, PID, Qty
CID C_name, C_State
PID P_Desc, P_Price

Table 3

Attribute Determines
DID Dname, EID, PID, Btime
EID Ename
PID Pname

Question 2 - 3NF solutions

Table 1

FID F_Name F_Phone
1 Howser 60192
2 Langley 45869
SID S_name
1 Adams
2 Jones
3 Smith
4 Baker
CID C_name FID
IS3108 Database 1
IS301 Program 2
EnrollmentID SID CID Grade
1 1 IS3108 A
2 1 IS301 B
3 2 IS3108 A
5 3 IS3108 B
7 4 IS3108 A
8 4 IS301 B

Table 2

PID P_Desc P_Price
7 Table 800
5 Desk 325
4 Chair 200
11 Dresser 500
CID C_Name C_State
2 Apex NC
6 Acme GA
OID O_Date
1006 10/24/09
1007 10/25/09
OOID OID CID PID Qty
1 1006 2 7 1
2 1006 2 5 1
3 1006 2 4 5
4 1007 6 11 4
5 1007 6 4 6

Table 3

EID Ename
1 Huey
5 Dewey
11 Louie
2 Jack
4 Jill
PID Pname
27 Alpha
25 Beta
22 Gamma
26 Pail
21 Hill
DID Dname
10 Finance
14 R&D
DDID DID EID PID Btime
1 10 1 27 4.5
2 10 5 25 3
3 10 11 22 7
4 14 2 26 8
5 14 4 21 9

Note:

All primary keys are on the first column of each table

All foreign keys have the same name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment