title: Access Appointment System
body: <p>I'm trying to produce a Dr-patient appointment system.  So far I have four tables:-</p>
  
  <pre><code> Patient:-         Doctor:-           Appointment:-             Availability:-
   patientID         doctorName         time                      time
   name              room               date                      doctorName
   address                              patientID
                                        doctorName 
  </code></pre>
  
  <p>All relationships are 1 to manys, with the many side coming out of the appointment table.</p>
  
  <p>Patient:- The table for patient details</p>
  
  <p>Doctor:- The table for doctor details</p>
  
  <p>Appointment:- the table for appointments</p>
  
  <p>Availability:- The table which stores timeslots each doctor is available</p>
  
  <p>However this is all relatively new stuff to me and I'm getting quite thrown. Firstly in the doctors table should I have a field for DoctorID and use that as a primary key instead of the doctors name? Even though there's only likely to ever be a handful of records in that table.</p>
  
  <p>Secondly if I was to change to DoctorID in all tables instead of the doctorName would I still easily able to access the doctorsName if and when required? This part is what confuses me, maybe I'm just over thinking these things.</p>
  
  <p>The reason I ask is for example say I was to produce a report of an appointment which showed the doctorID, I should be able to get the doctors name for the report based on the relationship right? Likewise for the patient based on patient ID.</p>
  
  <p>I'm guessing I also have enough information in the tables to check against and prevent appointment clashes.</p>
  
  <p>Many thanks,</p>