| | 217 | == Verification of Alternative Candidate Keys == |
| | 218 | |
| | 219 | A relation may contain multiple candidate keys. |
| | 220 | Therefore, after identifying one candidate key, we must verify whether another minimal attribute set can also determine all attributes of R. |
| | 221 | |
| | 222 | === Testing Possible Alternative Key === |
| | 223 | |
| | 224 | The only realistic possibility is replacing: |
| | 225 | |
| | 226 | priest_id |
| | 227 | |
| | 228 | with: |
| | 229 | |
| | 230 | church_id |
| | 231 | |
| | 232 | because of the dependency: |
| | 233 | |
| | 234 | priest_id → church_id |
| | 235 | |
| | 236 | However, the reverse dependency does NOT hold: |
| | 237 | |
| | 238 | church_id ↛ priest_id |
| | 239 | |
| | 240 | A church may have multiple priests, therefore church_id alone cannot uniquely determine priest information. |
| | 241 | |
| | 242 | === Alternative Key Attempt === |
| | 243 | |
| | 244 | K₂ = { |
| | 245 | attendance_id, |
| | 246 | venue_booking_id, |
| | 247 | photographer_booking_id, |
| | 248 | band_booking_id, |
| | 249 | registrar_booking_id, |
| | 250 | church_id |
| | 251 | } |
| | 252 | |
| | 253 | === Closure === |
| | 254 | |
| | 255 | Using the functional dependencies: |
| | 256 | |
| | 257 | attendance branch is determined |
| | 258 | venue booking branch is determined |
| | 259 | photographer booking branch is determined |
| | 260 | band booking branch is determined |
| | 261 | registrar booking branch is determined |
| | 262 | church branch is determined |
| | 263 | |
| | 264 | However, the closure cannot derive: |
| | 265 | |
| | 266 | priest_id |
| | 267 | priest_name |
| | 268 | priest_contact |
| | 269 | |
| | 270 | because: |
| | 271 | |
| | 272 | church_id ↛ priest_id |
| | 273 | |
| | 274 | Therefore: |
| | 275 | |
| | 276 | K₂⁺ ≠ R |
| | 277 | |
| | 278 | Conclusion: |
| | 279 | |
| | 280 | K₂ is NOT a candidate key. |
| | 281 | |
| | 282 | === Verification of Other Possible Replacements === |
| | 283 | |
| | 284 | No other attribute can replace any component of the identified key because each attribute determines an independent branch of the relation. |
| | 285 | |
| | 286 | || Attribute || Determines || |
| | 287 | || attendance_id || attendance/event/guest branch || |
| | 288 | || venue_booking_id || venue booking branch || |
| | 289 | || photographer_booking_id || photographer booking branch || |
| | 290 | || band_booking_id || band booking branch || |
| | 291 | || registrar_booking_id || registrar booking branch || |
| | 292 | || priest_id || priest/church branch || |
| | 293 | |
| | 294 | Removing or replacing any attribute causes loss of information that cannot be derived from the remaining attributes. |
| | 295 | |