23_Integrity.pdf - CITS1402 Relational Database Management...

This preview shows page 1 - 5 out of 19 pages.

CITS1402 Relational Database Management Systems Video 23 — Data Integrity Gordon Royle Department of Mathematics & Statistics
Data Integrity Databases are rarely static objects holding unchanging data. In general, the contents are constantly changing as users I Create data, I Read data, I Update data, I Delete data. It is vital that the database remains in a logically consistent state — so there are many mechanisms to maintain data integrity .
Low level What appears to the user to be a single operation may actually need several database operations to complete. So the operation “Transfer $ 100000 from Account A to Account B” would require I Increase balance of Account B by $ 100000 I Decrease balance of Account A by $ 100000 The database will temporarily be in an inconsistent state.
Transactions Transactions are a low-level mechanism to ensure that I No other database operations or users can manipulate the data while it is inconsistent In a multi-user database (e.g. a ticketing website), several users may be pursuing the same tickets at the same time. I The system can recover from unexpected external events Power cuts, disk crashes, internet drop-outs, etc We will study transactions in more detail later, but as SQLite is not a true multi-user database, it is less important than for other DBMS.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture