You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

该关系模式可能存在哪些函数依赖?验证给定FD是否适用

Functional Dependency Analysis for Relation Schema ABC

First, let’s start with the core business rules we have—these are the foundation for figuring out valid functional dependencies (FDs):

  • Every doctor has a unique registration number (doc-rego), which maps to their first name, surname, gender, and qualification details.
  • Patients are uniquely identified by pat-ID, which ties to their given name, surname, gender, date of birth, address, and phone number.
  • Each appointment between a patient and doctor gets a unique app-ID, which specifies the appointment’s date/time and type (long or short).

All Valid Functional Dependencies for ABC

Based on those rules, here are all the FDs that apply to the relation:

  • doc-rego → doc-firstname, doc-surname, doc-gender, doc-qualification
    Since doc-rego is a unique identifier for doctors, knowing this value lets you determine every attribute related to that doctor.
  • pat-ID → pat-givename, pat-surname, pat-gender, pat-DOB, pat-addr, pat-phone
    pat-ID is the unique patient identifier, so it determines all patient-specific information.
  • app-ID → pat-ID, doc-rego, app-datetime, app-type
    Each app-ID is one-of-a-kind per appointment, so it links to exactly one patient, one doctor, and the appointment’s datetime/type.

Verification of the Provided FDs

Let’s go through each of the FDs you shared to confirm if they hold:

fd1: doc-rego → doc-firstname, doc-surname

✅ This is valid. Since doc-rego uniquely identifies a doctor, each registration number will always map to the same first name and surname. Note: This FD is incomplete—doc-rego also determines doc-gender and doc-qualification per the given rules—but the stated FD itself is still correct.

fd2: patID → pat-givename, pat-surname, pat-gender, pat-DOB, pat-addr, pat-phone

✅ This is valid (assuming a typo). The relation uses pat-ID (with a hyphen) as the patient’s unique ID. If patID is just a typo for pat-ID, then this FD holds because the patient ID determines all their personal details.

fd3: app-ID → app-datetime, app-type

✅ This is valid. Each app-ID is unique to an appointment, so it will always correspond to exactly one date/time and type. Additionally, app-ID should also determine pat-ID and doc-rego because every appointment is between one patient and one doctor.


内容的提问来源于stack exchange,提问作者user24529

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 09:21:59