Aggregates, views and ACID transactions
SQL defines and manipulates relational data, while transactions protect consistency when multiple changes occur.
What you need to be able to do
- ConstructCalculations within a database using SQL’s aggregate functions
- DescribeDifferent database views
- DescribeHow transactions maintain data integrity in a database
Rapid Recall Deck
Say the answer aloud before flipping. Mark secure knowledge quickly and spend time on the gaps.
- What are the main SQL aggregate functions?: COUNT, MAX, MIN, SUM, and an average function (commonly AVG).
- Why are GROUP BY and aggregate functions often used together?: GROUP BY divides rows into categories, and aggregate functions calculate a summary value for each group.
- What is a virtual database view?: A stored query whose result is generated from underlying tables when the view is used rather than storing a separate full copy of the result.
- What is a materialized view?: A stored snapshot/result of a query that can improve read performance but must be refreshed to stay current.
- What does ACID stand for?: Atomicity, Consistency, Isolation, and Durability.
- What do BEGIN TRANSACTION, COMMIT, and ROLLBACK do?: BEGIN starts a transaction; COMMIT makes its successful changes permanent; ROLLBACK undoes the transaction's uncommitted changes.
Core knowledge and application
Calculations within a database using SQL’s aggregate functions
SQL defines and manipulates relational data, while transactions protect consistency when multiple changes occur.
Explain it without notes
Construct: Calculations within a database using SQL’s aggregate functions in the context of a relational database used for reporting and transactional updates.
- Aggregate functions on grouped data to aid reporting and decision-making
- Aggregate commands: AVERAGE, COUNT, MAX, MIN, SUM
Different database views
SQL defines and manipulates relational data, while transactions protect consistency when multiple changes occur.
Explain it without notes
Describe: Different database views in the context of a relational database used for reporting and transactional updates.
- Virtual views and materialized (snapshot) views
- Hiding data complexity, data consistency, independence, performance, query simplification, read-only data or updatable data, security
Core knowledge and application
How transactions maintain data integrity in a database
SQL defines and manipulates relational data, while transactions protect consistency when multiple changes occur.
Explain it without notes
Describe: How transactions maintain data integrity in a database in the context of a relational database used for reporting and transactional updates.
- Role of atomicity, consistency, isolation and durability (ACID) to ensure reliable processing of transactions
- Transaction control language (TCL) commands: BEGIN TRANSACTION, COMMIT, ROLLBACK
Aggregates, views and ACID transactions
SELECT CourseID,
COUNT(*) AS N,
AVG(Score) AS MeanScore,
MAX(Score) AS Highest,
MIN(Score) AS Lowest,
SUM(Score) AS Total
FROM ENROLLMENT
GROUP BY CourseID
HAVING COUNT(*) >= 5;
Virtual view
Stores the query definition and computes the current result when accessed. Useful for simplification, security and logical independence.
Materialized view
Stores a snapshot/result for faster reads, but the stored result must be refreshed to remain current.
BEGIN TRANSACTION; UPDATE ACCOUNT SET Balance = Balance - 100 WHERE ID = 1; UPDATE ACCOUNT SET Balance = Balance + 100 WHERE ID = 2; COMMIT; -- ROLLBACK would undo the transaction if the operation cannot complete safely.
Transfer to a new scenario
- Aggregate functions on grouped data to aid reporting and decision-making
- Aggregate commands: AVERAGE, COUNT, MAX, MIN, SUM
- Virtual views and materialized (snapshot) views
- Hiding data complexity, data consistency, independence, performance, query simplification, read-only data or updatable data, security
- Role of atomicity, consistency, isolation and durability (ACID) to ensure reliable processing of transactions
- Transaction control language (TCL) commands: BEGIN TRANSACTION, COMMIT, ROLLBACK
Paper 1 practice
- Construct: Calculations within a database using SQL’s aggregate functions in the context of a relational database used for reporting and transactional updates.
- Describe: Different database views in the context of a relational database used for reporting and transactional updates.
- Describe: How transactions maintain data integrity in a database in the context of a relational database used for reporting and transactional updates.
Finish the learning cycle
Exam preparation — main task
Complete targeted 2027 case-study research and cumulative Paper 1/Paper 2 practice. Record evidence and technical vocabulary you can use in extended responses.
Retrieval
Repeat today’s recall deck and revisit any item marked ‘Review again’.