Live rows, real Foreign Key values
Relationship Explorer
A table diagram tells you a relationship can exist. This page proves it by following one real row's actual id values from table to table.
ایک ٹیبل ڈایاگرام صرف یہ بتاتا ہے کہ دو ٹیبلز کے درمیان تعلق قائم ہو سکتا ہے۔ جبکہ یہ صفحہ ایک حقیقی ریکارڈ کی آئی ڈی (ID) ویلیوز کو ایک ٹیبل سے دوسرے ٹیبل تک ٹریس کر کے اس تعلق کو عملاً ثابت کرتا ہے۔
Student → Enrollment → Class
Parent → Student (via junction)
Teacher → Subject → Class
Student → Invoice → Payments
Exam → Student → Subject → Result
Exam → Student → Subject → Result
exams
Mid-Term Exam
exam_id = 1
+
students
Ali Khan
student_id = 1
+
subjects
Mathematics
subject_id = 1
→
exam_results
result_id = 1
marks: 95.00 (A+)
This is why exam_results carries THREE Foreign Keys and a
three-column UNIQUE constraint (exam_id, student_id, subject_id) — a single
result row only makes sense once you know all three at the same time.
Explain this page
- What am I looking at?
- One real example row from each side of a relationship, with the actual id values that
connect them printed in
monotext — not hidden behind a friendly name. The id is the entire mechanism. - Why does this matter?
- Understanding "student_id = 1 in both tables means the same student" is the single biggest unlock for reading and writing JOINs confidently.
- یہاں کیا نظر آ رہا ہے؟
- تعلق کے ہر رخ سے ایک حقیقی ریکارڈ لیا گیا ہے، اور آئی ڈی (ID) کی قدریں جو انہیں
آپس میں جوڑتی ہیں
monoفونٹ میں دکھائی گئی ہیں — کسی دوستانہ نام کے پیچھے چھپائی نہیں گئیں۔ آئی ڈی (ID) ہی پورا ربط کا ذریعہ ہے۔ - یہ کیوں اہم ہے؟
- یہ سمجھنا کہ "دونوں ٹیبلز میں
student_id = 1ایک ہی طالب علم کو ظاہر کرتا ہے" — جوائنز (JOINs) لکھنے اور سمجھنے کی سب سے بڑی کلید ہے۔