School DB Lab
Live from information_schema

Table Explorer

Every fact on this page — columns, types, keys, defaults, indexes — is read straight from MySQL's own catalogue. Click any table to see its full structure.

اس صفحے پر موجود ہر معلومات — کالمز (Columns)، ڈیٹا ٹائپس (Types)، کیز (Keys)، ڈیفالٹ ویلیوز (Defaults)، اور انڈیکسز (Indexes) — براہِ راست MySQL کے اپنے سسٹم کیٹلاگ سے لائیو پڑھی جا رہی ہے۔ کسی بھی ٹیبل پر کلک کر کے اس کی مکمل ساخت (Structure) دیکھی جا سکتی ہے۔

classes — 4 rows

A class/section for one academic year, e.g. "Grade 5 - A - 2025-2026".

COLUMNS

ColumnTypeKeysNull?DefaultExtra
class_id bigint(20) unsigned
PK
NOTNULL — auto_increment
class_name varchar(40)
UQ
NOTNULL — —
section varchar(10)
UQ
NOTNULL — —
academic_year varchar(9)
UQ
NOTNULL — —
room_no varchar(20)
NULL NULL —
capacity smallint(5) unsigned
NOTNULL 30 —
created_at timestamp
NOTNULL current_timestamp() —

FOREIGN KEYS (outgoing)

None — this table does not point to any other table.

REFERENCED BY (incoming)

Child tableChild columnRelationshipON DELETE
attendance class_id classes 1:M attendance RESTRICT
class_subject_teachers class_id classes 3-way assignment class_subject_teachers RESTRICT
exams class_id classes 1:M exams RESTRICT
student_enrollments class_id classes 1:M student_enrollments RESTRICT

UNIQUE CONSTRAINTS

UQ (class_name, section, academic_year)

INDEXES

UQ IDX (class_name, section, academic_year)
Explain this table
Primary Key
class_id — uniquely identifies every row.
What could go wrong?
Inserting a row with a duplicate UNIQUE value, a missing NOT NULL field, or a Foreign Key pointing at a row that doesn't exist. Try it in the Keys & Constraints Lab.
پرائمری کی (Primary Key)
class_id — ہر قطار کو منفرد شناخت دیتی ہے۔
کیا غلط ہو سکتا ہے؟
کسی ایسی قطار کو داخل کرنا جس میں پہلے سے موجود یونیک ویلیو (UNIQUE value) ہو، کوئی ضروری فیلڈ (NOT NULL) خالی چھوڑ دی گئی ہو، یا فارن کی (Foreign Key) کسی ایسی قطار کی طرف اشارہ کر رہی ہو جو موجود نہ ہو۔ اسے خود آزمائیں: Keys & Constraints Lab۔