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
Parent(s) ← Student (through student_parents)
students
Ali Khan
student_id = 1
↔
student_parents
junction rows
↔
parents
2 linked
| student_id | parent_id | Parent name | Relationship | Primary contact? |
|---|---|---|---|---|
| 1 | 1 | Imran Khan | Father | No |
| 1 | 2 | Nasreen Khan | Mother | Yes |
This student has 2 row(s) in student_parents —
one row per parent/guardian link. A Many-to-Many relationship always looks like this: several
junction rows sharing the same student_id, each pointing at a different parent_id.
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) لکھنے اور سمجھنے کی سب سے بڑی کلید ہے۔