Databases IGCSE
Databases IGCSE
Databases
6.1 Database Concepts
A database is an organized collection of data that can be easily accessed,
managed, and updated. Databases are essential for storing large amounts of
data efficiently, ensuring quick retrieval and manipulation.
6.1.1 Database Management System (DBMS)
A Database Management System (DBMS) is software that helps to manage
databases. It provides an interface for interacting with the data stored in a
database. Examples of DBMS include:
MySQL
Microsoft Access
Oracle
PostgreSQL
6.1.2 Types of Databases
Flat File Database: A simple database where data is stored in a single
table. It is easy to set up but is not scalable or efficient for complex data.
Relational Database: Data is organized into tables (also called relations)
with defined relationships between them. The data in tables is structured
using rows and columns, and each table has a primary key to identify
records uniquely.
Example:
sql
CopyEdit
SELECT Name, Grade FROM Students;
2. WHERE Clause
The WHERE clause is used to filter records.
sql
CopyEdit
SELECT * FROM Students WHERE Grade = 'A';
3. INSERT INTO Command
The INSERT INTO command is used to add new records to a table.
sql
CopyEdit
INSERT INTO Students (StudentID, Name, Age, Grade)
VALUES (4, 'David', 17, 'B');
4. UPDATE Command
The UPDATE command is used to modify existing records.
sql
CopyEdit
UPDATE Students
SET Grade = 'A'
WHERE StudentID = 2;
5. DELETE Command
The DELETE command is used to remove records from a table.
sql
CopyEdit
DELETE FROM Students WHERE StudentID = 3;
6. CREATE TABLE Command
The CREATE TABLE command is used to create a new table.
CopyEdit
CREATE TABLE Students (
StudentID INT PRIMARY KEY,
Name VARCHAR(100),
Age INT,
Grade CHAR(1)
);