Ravindra BagaleCourses & study guides Track your progress

Why Tables Join: Keys and Relationships — Ravi Sir's Cards

All SQL cards

Revision cards

Primary key and foreign key. Company data is split across tables so each fact is stored once. Keys tell you which rows belong together.
Primary key and foreign key · PNG

Interview cards

How do you check whether a column is really a unique key? I compare COUNT(*) with COUNT(DISTINCT key). If the two numbers are equal and the key has no NULLs, every value appears only once.
How do you check whether a column is really a unique key? · PNG

Comparison cards

Orphan key vs missing key. An orphan key has a value that matches no row in the other table. A missing key is NULL, so its current value is unknown.
Orphan key vs missing key · PNG