Unary Relationships

A unary relationship is a relationship between the rows of a single table. For example, if all of your known relatives are stored in a table named tblFamily, then you can represent the "mother" relationship as a unary relationship. Each record in the table will have a pointer (foreign key) to the record of their mother. Of course, the oldest known relatives in the table will have null values for their own mothers.



ID Name Born MotherID
100 Willaim 1848 --
101 Abigail 1850 --
102 Thomas 1869 101
103 Robert 1873 101
104 Sally Anne 1876 101
105 Susan 1899 104
106 George 1901 104
107 Georgia 1901 104
108 Libby 1919 105
109 Richard 1922 105
110 Allan 1922 107
111 Hazel 1924 107
112 Linda 1929 105
113 Larry 1942 108
114 Curly 1944 108
115 Moe 1946 108
116 Betty 1952 112
117 Anthony 1953 108
118 John 1954 111
119 Jean 1957 112
120 Edward 1959 111
121 Lucy 1969 116
122 Andrew 1973 116
123 Jim Bob 1980 119


Unary relationships, though not as common as binary relationships, do have many practical applications. They can be used to represent product subassemblies (e.g., part X is used as a component of part Y which is then used to make part Z). Unary relationships can be used to represent precedent conditions (e.g., MIS 304 and MIS 325 are prereqs MIS 333K). They can also be used to represent a boss-worker relationship (e.g., Susan Smith is John Jones' boss).

More FAQs