1.2.3) Databases Flashcards
What is a flat file database?
A database that has one table
What is a relational database?
A database with multiple related tables connected through keys
What is a primary key?
A unique identifier for a record in a table.
What is a foreign key?
A field in one table that links to the primary key in another which creates a relationship
What is a secondary key?
An attribute used to search the database but not always unique.
What is an entity in databases?
People or things
What is entity-relationship modelling (ERM)?
A diagram for showing entities and the relationships between them
What is a 1:1 relationship in ER modelling?
One entity relates to another one entity (e.g., Person → Passport).
What is a 1:M relationship in ER modelling?
One entity relates to many others (e.g., Customer → Orders).
What is a M:N relationship in ER modelling?
Many-to-many; must be broken into two 1:M with a linking table.
What is indexing in a database?
A technique for speeding up data retrieval, often using B-trees or hash tables.
Name two methods of data capture.
Forms and Optical Character Recognition (OCR).
How is data selected from a database?
Using queries like SQL SELECT statements and filters.
What are common data management tasks?
CRUD: Create, Read, Update, Delete operations.
What are two methods of exchanging data between systems?
JSON/XML files and APIs (Application Programming Interfaces).
What is normalisation?
The process of dividing larger tables into smaller interlinked tables
What does 1NF require?
Atomic fields and no repeating groups.
What does 2NF require?
1NF + no partial dependencies (non-key attributes must depend on the whole key).
What does 3NF require?
2NF + no transitive dependencies (non-key fields must depend only on the key).
What is a transitive dependency?
When a non-key attribute depends on another non-key attribute.
What does SELECT * FROM Customers; do?
Retrieves all columns and rows from the Customers table.
Write an SQL query to find customers in ‘London’.
SELECT * FROM Customers WHERE City = ‘London’;
What does UPDATE do in SQL?
Modifies existing data in a table.
What does DELETE FROM Orders WHERE OrderID = 101; do?
Deletes the order with OrderID 101 from the Orders table.