二、假設現有如下推拿就醫資訊的關連式資料庫,請使用 SQL 回答相關的子問題。
Naprapathist(nID, name, speciality)
Patient(pID, name, gender, birthday)
MedicalItem(mID, subject, description, charge)
MedicalRecord(mID, nID, pID, dateTime, extraCharge, totalCharge)
FKs: mID ref. MedicalItem(mID), nID ref. Naprapathist(nID), pID ref. Patient(pID)
其中 nID, mID, pID 是由 1000 開始每次增加 1 的自動編號整數,所有資料欄位不允空
白,totalCharge 是由 MedicalRecord 的 charge 跟 extraCharge 加總而來。