• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

integrity constraint

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The text below is from Date's database, why it would be unreasonable to declare an integrity constraint to that effect?

Correctness: By definition, the database is always at least in a consistent state where, following Chapter 9 (and indeed following the literature in general), we take consistent to mean, precisely, not violating any known integrity constraint." Note too that consistency in that sense is enforced by the DBMS. It follows that transactions always transform a consistent state into a consistent state, again by definition. But consistency alone is not enough; we want correctness, not mere consistency! In the case of the transaction in Fig. 15.1, for example, we want the total number of dollars in accounts 123 and 456 taken together not to change. However, it would be unreasonable to declare an integrity constraint to that effect (why?), and so we cannot expect the DBMS to enforce the requirement; indeed, we already know from Chapter 9 that consistency does not imply correctness. Sadly, therefore, all we can do—and all the DBMS can do is simply assume that transactions are correct, in the sense that they faithfully reflect just those real-world operations they are supposed to.
 
Saloon Keeper
Posts: 11184
244
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Integrity constraints make guarantees about a particular database state. If I showed you one particular database state and a set of constraints, you could tell me if the state conforms to the constraints by checking all the rows and columns in all tables.

The rule that the total amount of money hasn't changed after transferring money from one account to another can't be checked by inspecting just one database state, because it doesn't tell you how much money you had before the transfer. You need to inspect both the 'before' and the 'after' states to check the rule, and that's just not something that integrity constraints do.
 
Tara Far
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Integrity constraints make guarantees about a particular database state. If I showed you one particular database state and a set of constraints, you could tell me if the state conforms to the constraints by checking all the rows and columns in all tables.

The rule that the total amount of money hasn't changed after transferring money from one account to another can't be checked by inspecting just one database state, because it doesn't tell you how much money you had before the transfer. You need to inspect both the 'before' and the 'after' states to check the rule, and that's just not something that integrity constraints do.


Many thanks for the good explanation.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
integrity constraints

=> constraints is a set of rule and regulation
=> constraints are used to set limits on a table in the database
=> for example, you do not want two recorded in the same data then use unique key constraint
=> it is also used to apply relationship for two different table
=> 4 different types of constraints are there
Domain Integrity
Entity Integrity Constraint
Referential Integrity Constraint
Key Constraints

 
So there I was, trapped in the jungle. And at the last minute, I was saved by this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!