Ideally business rules, that can be re-enforced at the database layer, should be implemented at the database layer to ensure that the integrity of the data can be relied on and does not lead to an unexpected behaviour from the application. Rules such as validation rules, e.g., which fields/columns cannot be null, etc. common sense rules derived from business requirements, e.g., which combination of columns values are not allowed to repeat, etc. The fact is, the application sitting on top of the database may not be the only source from which data may be provided to the database. Those sources could be: A database administrator making authorized changes/entries to the database using data manipulation language (DML) Importing data through external files such as comma-separated value (CSV) files Migrating data from other databases or tables More often than not, developers do not take the time to put these basic requirements in the database layer and, as a result, applications that do not do a good job of handling these uniqueness scenarios result in allowing these unwanted situations arising.


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

Database,MySQL,Programming