5 Advanced Database Models Systems And Applications

Advanced Database · Unit 5 · 8 hrs

Advanced Database Models, Systems, and Applications

Exam-focused notes for Advanced Database Models, Systems, and Applications (Advanced Database, CSC475): what the TU syllabus asks and how it has actually been tested, with 4 solved past questions from this unit.

Advanced Database Models, Systems, and Applications in short

This unit surveys database models built for specialized needs that a plain relational schema does not address well: databases that react to events on their own, databases that remember the past, databases of geometric and multimedia data, databases that can infer new facts, and the retrieval techniques behind web search.

Advanced Database Models, Systems, and Applications: notes

Active Database Concepts and Triggers

An active database goes beyond storing and retrieving data by reacting to events as they happen, using triggers: procedures the DBMS invokes automatically in response to a specified database change, defined by the database administrator through an event-condition-action (ECA) rule (when this event occurs, if this condition holds, perform this action). A database with a set of such triggers is generally called an active database. Consider a banking system watching for fraud: the event is a transaction exceeding a threshold amount, the condition checks whether it also matches a suspicious pattern (several large transfers from different locations in a short window), and the action alerts the fraud team so a human can block the account or contact the customer.

Triggers fire at two different granularities. A row-level trigger is evaluated once for every affected row individually, so its action can inspect or modify that specific row, at some performance cost when many rows are affected at once. A statement-level trigger is evaluated once for the whole SQL statement or transaction regardless of how many rows it touched, which is faster but can only act on the statement as a whole rather than row by row. Active databases are used in production control (power plants), inventory management, financial trading, telecommunications and network management, air traffic control, and medical or financial decision support, but they remain hampered by weak methodological support for designing and analyzing rule sets, a lack of standardization across products, thin tooling for developing and administering triggers, and, in many prototypes, weak runtime performance.

What this unit covers

  • Active Database Concepts and Triggers
  • Temporal Database Concepts
  • Spatial Database Concepts
  • Multimedia Database Concepts
  • Deductive Database Concepts
  • Introduction to Information Retrieval and Web Search

Active Database Concepts and Triggers

2081 · 5 marks

What are triggers? What are the uses of triggers? [5]

Show solved answer

Triggers in Database Systems

Definition of Triggers

A trigger is a special type of stored procedure (or rule) in a database that is automatically executed (fired) in response to certain events occurring on a specified table or view. Triggers are a core component of active databases, where the database itself can react to changes without requiring explicit user commands.

A trigger is defined using the general form:

Event --> Condition --> Action  (ECA Model)
  • Event: An operation that fires the trigger (INSERT, UPDATE, DELETE)
  • Condition: An optional check that must be satisfied
  • Action: The procedure that executes when the trigger fires

Uses of Triggers

1. Enforcing Business Rules

Triggers automatically enforce complex business rules that cannot be handled by simple constraints. For example, ensuring that a bank account balance never goes below zero after a withdrawal.

2. Fraud Detection and Security Monitoring

In a banking system, triggers can monitor customer transactions and detect potential fraud activities, such as:

  • A high-value transaction exceeding a threshold
  • A series of unusual transactions from the same account at different locations within a short period
  • The trigger fires automatically and can alert the system or block the transaction.

3. Maintaining Data Integrity

Triggers ensure referential integrity and consistency across related tables, especially in situations where foreign key constraints alone are insufficient.

4. Automatic Auditing and Logging

Triggers can automatically record changes (INSERT, UPDATE, DELETE) made to sensitive tables into an audit log table, keeping a history of all modifications for accountability.

5. Derived Data Maintenance

Triggers can automatically update derived or summary data. For example, when a new sale is recorded, a trigger can automatically update the total sales figure in a summary table.

6. Replication and Synchronization

Triggers can be used to keep multiple copies of data synchronized by propagating changes from one table to related tables automatically.


Summary Table

UseDescription
Business RulesEnforce complex constraints automatically
Fraud DetectionMonitor and react to suspicious transactions
Data IntegrityMaintain consistency across tables
AuditingLog all changes for tracking
Derived DataAuto-update computed/summary values
SynchronizationKeep related data consistent

Triggers make the database active rather than passive, enabling it to respond intelligently to data changes without manual intervention.

Open this answer on its own page →

2080 · 5 marks

What is the concept of active database? What are triggers? [5]

An active database is a database system that goes beyond the traditional role of data storage and retrieval by incorporating active behaviour. It enables the database to react and respond to events and triggers in real-time, rather than passively waiting for user queries. A database with a set of...

Open this answer on its own page →

Spatial Database Concepts

2081 · 5 marks

Why do we need spatial databases? What are common types of analysis for spatial data? [5]

A spatial database is a database that is optimized to store and query data related to objects in space, including points, lines, polygons, and geographic features (maps, locations, regions). We need spatial databases for the following reasons: - Traditional relational databases cannot efficiently...

Open this answer on its own page →

2079 · 5 marks

What is spatial database? Explain the concept of trigger with an example. [5]

--- A spatial database is a database that is enhanced to store and access spatial data, or data that defines a geometric shape. These data are often associated with: - Geographic locations and features - Constructed features like cities, roads, buildings Data in spatial databases are stored as: D...

Open this answer on its own page →