| [Relational Theory] | [Carol's HomePage] |
![]()
| STUDENT_GRADES Table | ||||
|---|---|---|---|---|
| Row | StudentId | StudentName | CourseCode | Grade |
| 1 | 862345 | David Copperfield | IS3 | NCN |
| 2 | 862345 | David Copperfield | IS3 | HD |
| 3 | 862345 | David Copperfield | IS2 | D |
| 4 | 951234 | Mary Jones | PT1 | CR |
| 5 | 951239 | Bridget Jones | PT1 | N |
| 6 | 954555 | Bridget Jones | PT1 | P |
| 7 | 991020 | John Doe | PT2 | PS |
| 8 | 791021 | Dick Smith | PT2 | P |
| 9 | 791021 | Dick Smith | IS3 | null |
| 10 | 991042 | Richard Smith | IS3 | N |
| 11 | 991042 | Richard Smith | IS2 | P |
Below are three functional dependencies (FDs) for attributes in the table above
For each FD:
State whether the FD is Consistent or Inconsistent with the sample data in the table above
StudentId → StudentName
StudentId, CourseCode → Grade
Grade → StudentId
Consistent
We need to check each group of rows where the rows have the same X {StudentId}
The only interesting group (the group which contains more than one row) is the group which contains the first three rows from the table
Each time {StudentId} takes the value {862345},
{StudentName} takes the value {David Copperfield}
therefore the FD is consistent with the data in the table
Inconsistent
We need to check each group of rows where the rows have the same X {StudentId, CourseCode}
In the first row:
{StudentId, CourseCode} takes
the value {86234, IS3}
{Grade} takes the value {NCN}
In the second row:
{StudentId, CourseCode} takes
the value {86234, IS3}
{Grade} takes the value {HD}
therefore the FD is inconsistent with the data in the table
Cannot decide
In Row 9, the determinant {Grade} has a null value
![]()
| STUDENT_GRADES Table | |||
|---|---|---|---|
| StudentId | StudentName | CourseCode | Grade |
| 862345 | David Copperfield | IS3 | NCN |
| 862345 | D Copperfield | IS3 | HD |
| 862345 | Copperfield, David | IS2 | D |
| 991021 | Dick Smith | PT2 | P |
| 991021 | Dick Smith | IS3 | null |
Below is a functional dependency (FD) for attributes in the table above
State whether the FD is Consistent or Inconsistent with the sample data in the table above
StudentId → StudentName
Inconsistent
(which is a bit of a worry)
![]()
|
URL: http://computer/people/Carol.Edmondson/theory/FD_ConsistentInconsistent.shtml
Last modified: 08 December 2005 17:01:23 EST |