[Relational Theory] [Carol's HomePage]
Coloured Line

Consistent or Inconsistent FDs

Coloured Line


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


  1. StudentId → StudentName

  2. StudentId, CourseCode  →  Grade

  3. Grade → StudentId


  1. 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

  2. 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

  3. Cannot decide

    In Row 9, the determinant {Grade} has a  null value


Coloured Line


Another Instance of STUDENT_GRADES Table


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)


[Top]

Coloured Line

Carol Edmondson   <carol@cs.anu.edu.au>
URL: http://computer/people/Carol.Edmondson/theory/FD_ConsistentInconsistent.shtml
Last modified: 08 December 2005 17:01:23 EST