School DB Lab
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) ویلیوز کو ایک ٹیبل سے دوسرے ٹیبل تک ٹریس کر کے اس تعلق کو عملاً ثابت کرتا ہے۔

Teacher → Subject → Class (via class_subject_teachers)

teachers
Sarah Ahmed
teacher_id = 1
→
class_subject_teachers
assignment_id = 1
→
subjects
Mathematics
subject_id = 1
→
classes
Grade 5 - A
class_id = 1

One assignment row holds THREE Foreign Keys at once — it exists purely to answer "who teaches what, where" without students, classes, subjects or teachers needing to know about each other directly.

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 mono text — 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) لکھنے اور سمجھنے کی سب سے بڑی کلید ہے۔