A database is an organised, structured collection of related data stored electronically so it can be easily accessed, managed, and updated. In everyday life, databases power everything from bank records and railway reservation systems to school mark-sheets and social media profiles.
Why Databases?
Before databases, data was kept in flat files — individual text or binary files with no relationship between them. Problems with flat-file systems include data redundancy (same data stored in multiple places), data inconsistency (copies getting out of sync), poor security, and difficulty in concurrent access. A Database Management System (DBMS) solves all of these problems.
Key Definitions
DBMS (Database Management System): Software that acts as an interface between the database and its end users or application programs. It controls storage, retrieval, and management of data. Examples: MySQL, Oracle, PostgreSQL, SQLite, Microsoft SQL Server.
Data: Raw, uninterpreted facts (e.g., 42, "Priya", 2006-03-15).
Information: Processed, meaningful data that can support decision-making.
Database Administrator (DBA): The person responsible for designing, maintaining, backing up, securing, and tuning the database.
Advantages of a DBMS
- Reduces data redundancy — data is stored once; all applications share the same copy.
- Ensures data consistency — a single update propagates everywhere.
- Data integrity — rules (constraints) enforce correctness of data.
- Data security — user-level access control; only authorised users can read/modify.
- Concurrent access — multiple users can work simultaneously without conflict.
- Data independence — changing physical storage does not affect application programs.
Data Models
A data model describes how data is logically organised. The most widely used model today is the Relational Model (introduced by E.F. Codd, 1970).
Hierarchical Model: Data is arranged in a tree (parent-child). Fast for known access paths, but rigid.
Network Model: Extension of hierarchical; records can have multiple parents (graph structure).
Relational Model: Data is stored in tables (also called relations). Tables are linked through common columns (keys). This is the foundation of SQL.
Relational Database Terminology
| Term | Meaning |
|------|---------|
| Table / Relation | A 2-D grid of rows and columns |
| Tuple / Row / Record | A single horizontal entry in a table |
| Attribute / Column / Field | A vertical property (e.g., Name, Age) |
| Domain | The set of allowed values for an attribute |
| Degree | Number of columns (attributes) in a table |
| Cardinality | Number of rows (tuples) in a table |
Keys in a Relational Database
Primary Key: An attribute (or combination) that uniquely identifies each row in a table. It must be unique and not null. Example: StudentID in a Student table.
Candidate Key: Any attribute or minimal set of attributes that could serve as a primary key. One candidate key is chosen as the primary key; the rest are alternate keys.
Foreign Key: An attribute in one table that refers to the primary key of another table. It enforces referential integrity — you cannot add a record that references a non-existent primary key.
Composite Key: A primary key made up of two or more columns together.
Super Key: Any set of attributes that can uniquely identify a row (may include extra attributes beyond what is strictly necessary).
Relationships Between Tables
- One-to-One (1:1): Each record in Table A relates to exactly one record in Table B.
- One-to-Many (1:N): One record in Table A relates to many records in Table B (most common). Example: one teacher teaches many students.
- Many-to-Many (M:N): Many records on both sides. Usually resolved using a junction/bridge table.
Entity-Relationship (ER) Model
An ER diagram is a visual blueprint of a database before it is built.
- Entity: A real-world object about which data is stored (e.g., Student, Book).
- Attribute: A property of an entity (e.g., Name, ISBN).
- Relationship: An association between entities (e.g., Student · borrows · Book).
- Special attributes:
- Key attribute — uniquely identifies an entity (underlined in ER diagram).
- Composite attribute — made of sub-parts (Full Name = First + Last).
- Multi-valued attribute — can have multiple values (Phone Numbers).
- Derived attribute — computed from another (Age from Date of Birth).
Normalisation (Overview)
Normalisation is the process of organising a database to reduce redundancy and improve data integrity. The main Normal Forms are:
- 1NF (First Normal Form): Each column holds atomic (indivisible) values; no repeating groups.
- 2NF: In 1NF + every non-key attribute is fully dependent on the whole primary key (no partial dependency).
- 3NF: In 2NF + no transitive dependency (non-key attribute should not depend on another non-key attribute).
Common mistakes
- Confusing degree (number of columns) with cardinality (number of rows) — remember D for Degree = Dimensions of columns, C for Cardinality = Count of rows.
- Using a non-unique column as a primary key.
- Forgetting that a foreign key can be null (it represents an optional relationship).
- Mixing up candidate key and primary key — all primary keys are candidate keys, but not vice versa.
Summary
A DBMS provides a structured, secure, and efficient way to store and manage data. The relational model uses tables linked by keys. Understanding primary keys, foreign keys, ER diagrams, and basic normalisation is essential for the CBSE board examination and real-world database design.