Database Fundamentals
Think of a database as a well-organised filing cabinet. In your daily life, you already manage small databases without realising it — your phone's contact list, the catalogue of a library, or even the list of students in a class register. Each of these is a collection of related information stored in a structured way so that you can find what you need quickly.
What Exactly Is a Database?
A database is a collection of related data that is stored and managed systematically. The key word here is related. A random pile of papers on a desk is not a database — but the same papers, sorted into folders with labels and a clear order, become one. The purpose of a database is to allow efficient storage, retrieval, modification, and deletion of data.
A database is not the same as a spreadsheet. A spreadsheet is a single table meant for one person's use. A database is designed for multiple users, handles large volumes of data, and ensures that the data remains consistent even when many people access it at once.
Why Do We Need Databases?
Imagine a small business that keeps customer orders in a notebook. As the business grows, the notebook becomes impossible to manage — pages get lost, two customers might be given the same order number, and finding a specific order takes forever. A database solves all these problems.
Databases provide:
- Centralised control — all data lives in one place, so everyone works with the same information
- Data consistency — rules can be enforced (for example, an order must belong to a real customer)
- Security — different users can be given different levels of access
- Reduced redundancy — the same piece of information is not stored in multiple places unnecessarily
- Data independence — the way data is stored can change without affecting how users view it
The Core Idea: Tables and Relationships
The most common type of database is the relational database. Think of it as a collection of tables, where each table stores information about one kind of thing.
A table is made up of rows and columns. Each column represents a field (a single piece of information, like a name or a date), and each row represents a record (one complete set of fields, like one customer's full details).
For example, a university might have a Student table with columns: Roll Number, Name, Date of Birth, and Course. Each row is one student.
The real power comes from relationships between tables. The same university might have a Course table and an Enrolment table. The Enrolment table links a student to a course using the student's roll number and the course code — without repeating all the student's details or all the course details. This is what makes a database efficient.
The primary key is a column (or a set of columns) that uniquely identifies each row in a table. For the Student table, Roll Number is the primary key — no two students can share the same roll number. A foreign key is a column in one table that refers to the primary key of another table, creating the link between them.
Database Management System (DBMS)
A Database Management System is the software that lets you create, manage, and interact with a database. You do not directly touch the data files — the DBMS does that for you. Popular examples include MySQL, Oracle, and Microsoft Access.
The DBMS handles:
- Data storage and retrieval — it decides how to physically store data on a disk
- Query processing — when you ask for "all students born after 2005", the DBMS finds the answer …