What is a database?
A structured electronic collection of data that can be stored, searched, updated, and organised.
Databases are essential for managing large amounts of information efficiently.
What is a table in a database?
A collection of similar records (rows) with shared fields (columns).
Tables are fundamental components of a database structure.
What is a record (row)?
One entry representing a single item (e.g., one customer).
Each record contains data related to a specific instance.
What is a field (column)?
A single piece of information about a record (e.g., name, email).
Fields define the attributes of the data stored in a record.
What is a primary key?
A unique, non-NULL identifier for a row.
Primary keys ensure that each record can be uniquely identified.
What is a foreign key?
A field referencing a primary key in another table to link data.
Foreign keys establish relationships between tables.
What is structured data?
Data stored in fixed formats like tables (rows + columns).
Structured data is easily searchable and organized.
What is semi-structured data?
Flexible data with some structure, like JSON or XML.
Semi-structured data allows for more variability in data representation.
What is unstructured data?
Data with no fixed format (images, videos, PDFs).
Unstructured data is often more challenging to analyze.
What is normalisation?
The process of splitting data into clean, organised tables to remove duplication.
Normalisation helps maintain data integrity.
What does 1NF remove?
Repeating groups and multi-value cells; enforces atomic data.
First Normal Form ensures that each field contains only atomic values.
What does 2NF remove?
Partial dependencies when using a composite primary key.
Second Normal Form ensures that all non-key attributes are fully functional dependent on the primary key.
What does 3NF remove?
Transitive dependencies (non-key columns depending on non-key columns).
Third Normal Form aims to eliminate redundancy in data.
What is SQL?
Structured Query Language used to interact with relational databases.
SQL is the standard language for managing and manipulating databases.
What are examples of DDL commands?
DDL commands are used to define and modify database structures.
What are examples of DML commands?
DML commands are used to manipulate data within the database.
What are examples of DCL commands?
DCL commands are used to control access to data in the database.
What are TCL commands?
TCL commands manage transactions in a database.
What does an INNER JOIN return?
Only matching rows from both tables.
INNER JOIN is used to combine rows from two or more tables based on a related column.
What does a LEFT JOIN return?
All rows from the left table plus matches from the right.
LEFT JOIN includes all records from the left table, even if there are no matches in the right table.
What is an index?
A structure that speeds up searches by avoiding full table scans.
Indexes improve the performance of database queries.
What is a clustered index?
The table’s physical order; only one allowed.
A clustered index determines the order in which data is stored in a table.
What is a non-clustered index?
A separate lookup structure pointing to rows; many allowed.
Non-clustered indexes do not affect the physical order of data.
What is OLTP used for?
Fast inserts, updates, and real-time transactions (e.g., banking).
OLTP systems are optimized for transaction-oriented applications.