Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Database normalization
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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!
=== Satisfying DKNF === Let's have a look at the '''Book''' table from previous examples and see if it satisfies the [[domain-key normal form]]: {| class="wikitable" |+Book !<u>Title</u> !'''Pages''' !Thickness !''Genre ID'' !''Publisher ID'' |- |Beginning MySQL Database Design and Optimization |520 |Thick |''1'' |''1'' |- |The Relational Model for Database Management: Version 2 |538 |Thick |''2'' |''2'' |- |Learning SQL |338 |Slim |''1'' |''3'' |- |SQL Cookbook |636 |Thick |''1'' |''3'' |} Logically, '''Thickness''' is determined by number of pages. That means it depends on '''Pages''' which is not a key. Let's set an example convention saying a book up to 350 pages is considered "slim" and a book over 350 pages is considered "thick". This convention is technically a constraint but it is neither a domain constraint nor a key constraint; therefore we cannot rely on domain constraints and key constraints to keep the data integrity. In other words β nothing prevents us from putting, for example, "Thick" for a book with only 50 pages β and this makes the table violate [[Domain-key normal form|DKNF]]. To solve this, a table holding enumeration that defines the '''Thickness''' is created, and that column is removed from the original table: {| | {| class="wikitable" |+Thickness Enum !<u>Thickness</u> !Min pages !Max pages |- |Slim |1 |350 |- |Thick |351 |999,999,999,999 |} | {| class="wikitable" |+Book - Pages - Genre - Publisher !<u>Title</u> !Pages !''Genre ID'' !''Publisher ID'' |- |Beginning MySQL Database Design and Optimization |520 |''1'' |''1'' |- |The Relational Model for Database Management: Version 2 |538 |''2'' |''2'' |- |Learning SQL |338 |''1'' |''3'' |- |SQL Cookbook |636 |''1'' |''3'' |} |} That way, the domain integrity violation has been eliminated, and the table is in [[Domain-key normal form|DKNF]].
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Database normalization
(section)
Add topic