What is a natural key?
A natural key is derived from real-world business data, such as an ISO country code. Natural keys can be meaningful but may change or have complex validati
The question library
Explore practical questions, clear explanations, and code examples across developer technologies.
Showing 3205–3216 of 3610 questions
A natural key is derived from real-world business data, such as an ISO country code. Natural keys can be meaningful but may change or have complex validati
NULL represents missing or unknown data, not zero or an empty string. Use IS NULL or IS NOT NULL to test for it.
NULL means no known value; an empty string is a known string containing zero characters. Whether empty strings are allowed is a business and engine-specifi
Data types define what values a column can store and how they are represented, compared, and calculated.
CHAR is fixed-length in many systems; VARCHAR is variable-length up to a declared limit. Padding and storage behavior differ by engine.
DECIMAL/NUMERIC stores exact decimal values within defined precision and scale, making it appropriate for currency calculations where rounding rules matter
A constraint is a database-enforced rule, such as PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, or CHECK.
UNIQUE prevents duplicate values for a column or combination of columns, subject to each database's handling of NULLs.
CHECK enforces a Boolean condition on inserted or updated values.
A DEFAULT supplies a value when an INSERT omits the column or requests DEFAULT; it does not generally replace an explicitly supplied NULL.
Normalization organizes tables to reduce redundancy and update anomalies by separating facts into appropriate relations.
Denormalization deliberately duplicates or precomputes data to improve specific read patterns, at the cost of additional consistency and update complexity.