Database design Goals: The prime goal of designing a database is:
- To have zero redundancy in the system
- Loss-less join
- Dependency preservation
- Overcome all the shortcomings of conventional file system
According to E.F. Codd, “All the records of the table must be unique”.
Keys of a relation: There are various types of keys in a relation which are:
- Candidate Key: The minimal set of attributes that can determine a tuple uniquely. There can be more than 1 candidate key of a relation and its proper subset can’t determine tuple uniquely and it can’t be NULL.
- Super Key: The set of attributes that can determine a tuple uniquely. A candidate key is always a super key but vice versa is not true.
- Primary Key and Alternate Key: Among various candidate keys, one key is taken as the primary key and others are alternate keys.
- Foreign Key: Foreign Key is a set of attributes in a table that is used to refer to the primary key or alternative key of the same or another table.
**Functional Dependency:** It is a constraint that specifies the association/ relationship between a set of attributes. In functional dependency, one set can accurately determine the value of another set. It is represented as A->B, where set A can determine the values of set B correctly. The A is known as the Determinant, and B is known as the Dependent.
Functional dependencies are further categorized into two types:
- Trival Functional Dependency: In functional dependency, if B is a subset of A, then such dependency is known as trivial functional dependency.
- Non-Trivial Functional Dependency: In functional dependency, if B is not a subset of A, then such dependency is known as non-trivial functional dependency.
Armstrong’s Axioms: It is a statement that is always considered true and used as a starting point for further arguments. Armstrong axiom is used to generate a closure set in a relational database.
Armstrong Axiom
**Attribute Closure(X+):** All attributes of the set are functionally determined by X.
- Prime Attribute: An attribute that is part of one candidate key.