Documente Academic
Documente Profesional
Documente Cultură
Properties:
1. Entries in columns are atomic (or single-valued). 2. Entries in columns are from the same domain. 3. Each row is unique (no duplicate rows). 4. The sequence of columns (left to right) is insignificant. 5. The sequence of columns (top to bottom) is insignificant.
Entries in columns are atomic (or single-valued) PATIENT patientNo name dateVisit physician symptoms
987 988
John Miranda
To correct the relation: PATIENT patientNo name dateVisit physician symptoms Make separate rows.
AARGV
Each row is unique (no duplicate rows) Primary key - is an attribute that uniquely identifies the instance row. PATIENT patientNo name dateVisit physician symptoms
u n i q u
e
The sequence of columns (left to right) is insignificant PATIENT patientNo dateVisit name symptoms physician
The sequence of columns (top to bottom) is insignificant. PATIENT patientNo name dateVisit physician symptoms
AARGV
Functional Dependency Relationship between two attributes o A > B o A is determinant of B o The value of A uniquely determined the value of B o The functional dependence of B & A. Problem No. 1 Determined the functional dependency notation and primary
0123 0124
Solution:
Problem No. 2 Determine the functional dependency notation and primary key
AARGV
A+ A F C
GradeSheet: StudentNo, SubjectCode -> Grade Therefore relation is: GradeSheet: (StudentNo, SubjectCode, Grade) Composite key primary key with more than one attribute.
Partial Functional Dependency Dependency in which one or more non-key attribute are functionally dependent on part (but not all) of the primary key. Problem No. 3 Determine the functional dependencies and primary key.
Javascript C# MySQL
PFD
AARGV
Therefore the relation is: EMPLOYEE (EmpID, Training, Name, Dept, Salary, TrainingDate) To remove partial dependency, split the relation into new relations according to functional dependencies. PERSONNEL: (EmpID, Name, Dept, Salary) TRAINING: (EmpID, Training, TrainingDate) SPLIT THE RELATION INTO TWO: EMPLOYEE EmpID Name Dept Salary Training TrainingDate
Javascript C# MySQL
Training
TrainingDate
Javascript C# MySQL
AARGV
Personnel
0 MAXIMUM
Training
CORDINALITY CONSTRAINTS Specifies the number of instances of one entity that can (or must) be associated with each instance of another entity.
Why remove partial dependency? EMPLOYEE EmpID Name Dept Salary Training TrainingDate
Javascript C# MySQL
There is Anomalies:
AARGV
Modifications How many times do we need to update Ivys record is she intends to transfer at business intelligence dept? Insertion If new employee is entered, you are forced to put an entity on training BECAUSE it is part of primary key. Deletion if Janneth is deleted, do we need to delete all the training she took.
Transitive Dependency A function dependency between two or more non-key attributes in a relationship. Problem No. 4 Determine the functional dependencies and primary key.
M F F
Non-key Attribute
Transitive dependent
EMPLOYEE (EmpID, Name, Gender, BranchCode, BranchName) The other partial functional dependent or transitive dependents from the given relation?
M F F
Name
Gender
BranchCode
M F F
BranchCode
BranchName
Foreign Key is an attribute that appears as a non-key attributes in the relation and as a primary key in another relation.
Personnel
Branch
(BranchCode, BranchName)
AARGV