Can You Understand This Database?
25 questions. Try answering each one yourself first — then reveal the answer and follow the link to prove it live.
پچیس اہم سوالات۔ پہلے ہر سوال کا جواب خود دینے کی کوشش کریں — پھر جواب کھولیں اور دیے گئے لنک پر جا کر لائیو لیب میں اس کی تصدیق کریں۔
1 How many tables exist?
There are 21 tables — see the full list on the Table Explorer.
2 What is the Primary Key of students?
student_id, an auto-incrementing BIGINT UNSIGNED.
3 Which table connects students and parents?
student_parents.
4 Why is it a junction table?
Because neither students nor parents can hold a list of the other — a junction table stores one row per link instead.
5 How are students connected to classes?
Through student_enrollments, which holds a student_id and a class_id Foreign Key.
6 Which relationship is One-to-Many?
Students to Enrollments, Classes to Enrollments, Invoices to Payments, and several others — one parent row, many child rows.
See it live →7 Which relationship is Many-to-Many?
Students and Parents, resolved through the student_parents junction table.
8 Why is admission_no UNIQUE?
So the school can never accidentally issue the same admission number to two different students.
See it live →9 Why do we use Foreign Keys?
To guarantee a value in a child table always points at a row that genuinely exists in the parent table — preventing orphan records.
See it live →10 What happens when an invalid student_id is entered?
MySQL rejects the INSERT with a Foreign Key constraint error, before the row is ever written.
See it live →11 What is an orphan record?
A row whose Foreign Key points at a parent row that no longer exists.
See it live →12 How do we detect duplicates?
GROUP BY the column(s) that should be unique, then HAVING COUNT(*) > 1.
13 What is an index?
A separate, sorted lookup structure MySQL maintains to find matching rows faster, at some storage and write-speed cost.
See it live →14 What is a composite index?
An index built across more than one column, where column order determines which queries it can help.
See it live →15 What does JOIN do?
Combines rows from two or more tables by matching a column in one to a column in another.
See it live →16 Difference between INNER JOIN and LEFT JOIN?
INNER JOIN keeps only rows with a match on both sides. LEFT JOIN keeps every row from the left table, filling in NULL where no match exists.
See it live →17 What does a transaction protect?
Multi-step writes that must all succeed or all fail together — never left half-done.
See it live →18 What is COMMIT?
Makes every write since START TRANSACTION permanent.
See it live →19 What is ROLLBACK?
Undoes every write since START TRANSACTION, as if it never happened.
See it live →20 How can we inspect a table structure?
The Table Explorer, the Data Dictionary, or running SHOW CREATE TABLE / DESCRIBE directly.
21 How can we inspect Foreign Keys?
The Table Explorer lists them per table; information_schema.KEY_COLUMN_USAGE is the underlying source.
22 How can we diagnose a failed INSERT?
Read the actual database error message — it names the exact constraint that rejected the row.
See it live →23 How can we see which tables are connected?
The Database Map diagram, or the Relationship Explorer for live examples.
See it live →24 Why should we not blindly use ON DELETE CASCADE?
Because it can silently destroy historical or financial records the moment a parent row is deleted — RESTRICT forces a deliberate decision instead.
See it live →25 How can we verify an AI-generated (or any) database design?
Load it, seed it with real-looking data, run the Integrity Checker, try to break every constraint on purpose, and read the actual CREATE TABLE output rather than trusting a description of it.
See it live →Explain this page
- How should I use this checklist?
- Cover the answer, try to explain the concept in your own words, then click to reveal. If you can answer correctly and also follow the link to prove it live in the lab, you have moved from reading about the concept to genuinely understanding it.
- Why is "prove it live" important?
- Anyone can memorise a definition. Clicking through to the live lab and demonstrating the same answer with real data — a real JOIN, a real constraint violation, a real EXPLAIN plan — is what converts book knowledge into practical database skill.
- اس چیک لسٹ کو کیسے استعمال کریں؟
- جواب چھپائیں، اس تصور کو اپنے الفاظ میں بیان کرنے کی کوشش کریں، پھر کلک کر کے جواب دیکھیں۔ اگر آپ درست جواب دے سکتے ہیں اور لائیو لیب میں جا کر اسے عملاً ثابت بھی کر سکتے ہیں، تو آپ محض پڑھنے سے آگے بڑھ کر حقیقی سمجھ تک پہنچ گئے ہیں۔
- "لائیو ثابت کرنا" اہم کیوں ہے؟
- تعریف رٹنا آسان ہے۔ لائیو لیب پر جا کر اصل ڈیٹا سے — ایک حقیقی جوائن (JOIN)، ایک حقیقی کنسٹرینٹ خلاف ورزی (Constraint Violation)، ایک حقیقی EXPLAIN پلان — وہی جواب ظاہر کرنا، یہی کتابی علم کو عملی ڈیٹا بیس مہارت میں بدلتا ہے۔