Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Database normalization
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Objectives == A basic objective of the first normal form defined by Codd in 1970 was to permit data to be queried and manipulated using a "universal data sub-language" grounded in [[first-order logic]].<ref>"The adoption of a relational model of data ... permits the development of a universal data sub-language based on an applied predicate calculus. A first-order predicate calculus suffices if the collection of relations is in normal form. Such a language would provide a yardstick of linguistic power for all other proposed data languages, and would itself be a strong candidate for embedding (with appropriate syntactic modification) in a variety of host languages (programming, command- or problem-oriented)." Codd, [https://dl.acm.org/doi/10.1145/362384.362685 "A Relational Model of Data for Large Shared Data Banks"] {{Webarchive|url=https://web.archive.org/web/20070612235326/http://www.acm.org/classics/nov95/toc.html |date=June 12, 2007 }}, p. 381</ref> An example of such a language is [[SQL]], though it is one that Codd regarded as seriously flawed.<ref>Codd, E.F. Chapter 23, [https://dl.acm.org/doi/10.5555/77708.C1065772 "Serious Flaws in SQL"], in ''The Relational Model for Database Management: Version 2''. Addison-Wesley (1990), pp. 371β389</ref> The objectives of normalization beyond 1NF (first normal form) were stated by Codd as: {{Blockquote| # To free the collection of relations from undesirable insertion, update and deletion dependencies. # To reduce the need for restructuring the collection of relations, as new types of data are introduced, and thus increase the life span of application programs. # To make the relational model more informative to users. # To make the collection of relations neutral to the query statistics, where these statistics are liable to change as time goes by. |E.F. Codd|"Further Normalisation of the Data Base Relational Model"<ref>Codd, E.F. "Further Normalisation of the Data Base Relational Model", p. 34</ref>}} [[File:Insertion anomaly.svg|thumb|280px|An '''insertion anomaly'''. Until the new faculty member, Dr. Newsome, is assigned to teach at least one course, their details cannot be recorded.]] [[File:Update anomaly.svg|thumb|280px|An '''update anomaly'''. Employee 519 is shown as having different addresses on different records.]] [[File:Deletion anomaly.svg|thumb|280px|A '''deletion anomaly'''. All information about Dr. Giddens is lost if they temporarily cease to be assigned to any courses.]] When an attempt is made to modify (update, insert into, or delete from) a relation, the following undesirable side effects may arise in relations that have not been sufficiently normalized: ;Insertion anomaly: There are circumstances in which certain facts cannot be recorded at all. For example, each record in a "Faculty and Their Courses" relation might contain a Faculty ID, Faculty Name, Faculty Hire Date, and Course Code. Therefore, the details of any faculty member who teaches at least one course can be recorded, but a newly hired faculty member who has not yet been assigned to teach any courses cannot be recorded, except by setting the Course Code to [[null (SQL)|null]]. ;Update anomaly: The same information can be expressed on multiple rows; therefore updates to the relation may result in logical inconsistencies. For example, each record in an "Employees' Skills" relation might contain an Employee ID, Employee Address, and Skill; thus a change of address for a particular employee may need to be applied to multiple records (one for each skill). If the update is only partially successful β the employee's address is updated on some records but not others β then the relation is left in an inconsistent state. Specifically, the relation provides conflicting answers to the question of what this particular employee's address is. ;Deletion anomaly: Under certain circumstances, the deletion of data representing certain facts necessitates the deletion of data representing completely different facts. The "Faculty and Their Courses" relation described in the previous example suffers from this type of anomaly, for if a faculty member temporarily ceases to be assigned to any courses, the last of the records on which that faculty member appears must be deleted, effectively also deleting the faculty member, unless the Course Code field is set to null. === Minimize redesign when extending the database structure === A fully normalized database allows its structure to be extended to accommodate new types of data without changing existing structure too much. As a result, applications interacting with the database are minimally affected. Normalized relations, and the relationship between one normalized relation and another, mirror real-world concepts and their interrelationships.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)