appointment_slots
+----+-----------+---------------+---------------------+
| id | doctor_id | polyclinic_id | slot |
+----+-----------+---------------+---------------------+
| 1 | 1 | 2 | 2018-03-09 08:00:00 |
| 2 | 1 | 2 | 2018-03-09 08:15:00 |
| 3 | 1 | 2 | 2018-03-09 08:30:00 |
+----+-----------+---------------+---------------------+
appointments
+----+------------+---------+
| id | patient_id | slot_id |
+----+------------+---------+
| 1 | 5 | 2 |
| 2 | 12 | 3 |
+----+------------+---------+
Böyle iki tablo olduğunu düşünün randevu saatleri (appointment_slots) ve randevular (appointments).
Yukarıdaki tablolara göre;
Hasta kenya'nın (
appointments.patient_id=5 ⇆
users.id=5)
Kulak Burun Boğaz polikliniğinde (
appointment_slots.polyclinic_id=2 ⇆
polyclinics.id=2)
Uzm. Dr. mgsmus'dan (
appointment_slots.doctor_id=1 ⇆
users.id=1)
9 Mart Cuma saat 08:15'de (
appointment_slots.id=2)
randevusu var.
Temel düzeyde bu şekilde