ArticleslgStudy

science

Domain-key normal form

Domain-key normal form is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Domain-key normal form rather than just read about it. In short: Domain-key normal form (DK/NF or DKNF) is a normal form used in database normalization which requires that the database contains no constraints other than domain constraints and key constraints. A domain constraint specifies the permissible values for a given attribute, while a key constraint specifies the attributes that uniquely identify a row in a given table.

Key takeaways

  • Domain-key normal form belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Domain-key normal form to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Domain-key normal form from memory before moving on to harder problems.

Reference excerpt

Domain-key normal form (DK/NF or DKNF) is a normal form used in database normalization which requires that the database contains no constraints other than domain constraints and key constraints. A domain constraint specifies the permissible values for a given attribute, while a key constraint specifies the attributes that uniquely identify a row in a given table. The domain/key normal form is achieved when every constraint on the relation is a logical consequence of the definition of keys and domains, and enforcing key and domain restraints and conditions causes all constraints to be met. Thus, it avoids all non-temporal anomalies. The reason to use domain/key normal form is to avoid having general constraints in the database that are not clear domain or key constraints. Most databases can easily test domain and key constraints on attributes. General constraints however would normally require special database programming in the form of stored procedures (often of the trigger variety) that are expensive to maintain and expensive for the database to execute. Therefore, general constraints are split into domain and key constraints. It's much easier to build a new database in domain/key normal form than it is to convert from databases on lesser normal forms which may contain numerous anomalies. However, successfully building a domain/key normal form database remains a difficult task, even for experienced database programmers. Thus, while the domain/key normal form eliminates the problems found in most databases, it tends to be the most costly normal form to achieve. However, failing to achieve the domain/key normal form may carry long-term, hidden costs due to anomalies which appear in databases adhering only to lower normal forms over time. The third normal form, Boyce–Codd normal form, fourth normal form and fifth normal form are special cases of the domain/key normal form. All have either functional, multi-valued or join dependencies that can be converted into superkeys. The domains on those normal forms were unconstrained so all domain constraints are satisfied. However, transforming a higher normal form into domain/key normal form is not always a dependency-preserving transformation and therefore not always possible.

Example A violation of DKNF occurs in the following table:

(Assume that the domain for Wealthy Person consists of the names of all wealthy people in a pre-defined sample of wealthy people; the domain for Wealthy Person Type consists of the values 'Millionaire' and 'Billionaire'; and the domain for Net Worth in Dollars consists of all integers greater than or equal to 1,000,000.) There is a constraint linking Wealthy Person Type to Net Worth in Dollars, even though we cannot deduce one from the other. The constraint dictates that a Millionaire will have a net worth of 1,000,000 to 999,999,999 inclusive, whilst a Billionaire will have a net worth of 1,000,000,000 or higher. This constraint is neither a domain constraint nor a key constraint; therefore we cannot rely on domain constraints and key constraints to guarantee that an inconsistent Wealthy Person Type / Net Worth in Dollars combination does not make its way into the database. The DKNF violation could be eliminated by removing the Wealthy Person Type column. The wealthy person's status as a millionaire or billionaire is determined by their Net Worth in Dollars, as defined in the Wealthiness Status table, so no useful information is lost.

Foreign keys Relationships that are impossible to express as foreign keys are obvious violations of DKNF. For example, a "Parent ID" attribute that points to one of several referenced tables, depending on a second "Parent Type" attribute, violates DKNF.

See also Referential integrity Database normalization

References

External links Database Normalization Basics Archived 2007-02-05 at the Wayback Machine by Mike Chapple (About.com) An Introduction to Database Normalization by Mike Hillyer. Normalization by ITS, University of Texas. A tutorial on the first 3 normal forms by Fred Coulson Description of the database normalization basics by Microsoft

Worked examples

Example 1 — a first encounter with Domain-key normal form

Start with the simplest possible case. Write down what Domain-key normal form claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Domain-key normal form before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Domain-key normal form ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Domain-key normal form

In research
Domain-key normal form appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Domain-key normal form in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Domain-key normal form is common in secondary-school and first-year university syllabi. It links to neighbouring topics Database normalization, so understanding it makes those chapters shorter.
In everyday life
Look for Domain-key normal form outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Domain-key normal form” →

How to study Domain-key normal form in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Domain-key normal form means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Domain-key normal form out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Domain-key normal form in simple terms?

Domain-key normal form (DK/NF or DKNF) is a normal form used in database normalization which requires that the database contains no constraints other than domain constraints and key constraints. A domain constraint specifies the permissible values for a given attribute, while a key constraint speci…

Why does Domain-key normal form matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Domain-key normal form?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Domain-key normal form.

Tags

  • Database normalization

Keep exploring