You are on page 1of 2

Trigger: Triggers are the procedures stored in the database that are executed when the content in a

database table is modified. In other words trigger can be defined as a set of actions that gets executed
when a database event occurs.
Cursors: Cursors refers to a control structure for the successive traversal of records in a result set as
returned by a query. Cursors allow us to manipulate the data contained within a memory are for internal
processing of a sql statement.
Database Life Cycle: (a) Initial study of a database (b) Database design (c) Implementing and loading
database (d) Testing and evaluating a database (e) Database operation (f) Maintenance and evaluation of
a database
Database Anomalies: Insertion Anomalies these occur when it becomes to difficult to insert data in
the database. We cannot insert data having null values in a table, which has a primary key constraint.
Deletion Anomalies These occur when the deletion of a particular record affects the existence of a
particular relation in the database. Modification Anomalies These occur when a database user changes
the value of a data item and the value of that data item does not change in other tables.
Normalization: Normalization is a process of eliminating the redundancy of a data in a database. A
relational table in a database is said to be in a normal form if it satisfies certain constraints. Goals of
normalization are: Removing the redundant data and ensuring that only related data is stored in a table.’
Advantages: (a) It provides better overall database organisation and data consistency within a database
(b) It allows us to create tables that can be easily joined with other tables with related information. (c) It
helps to reduce redundant data across the tables (d) It prevents data loss by assigning primary key and
foreign keys in a table. (e) it helps to reduce modification anomalies such as deletion, insertion and
update anomalies (f) It defines relation constraints that are a logical consequence of keys.
Inference Rules and Attribute Closure Inference rules for functional dependencies define the new
dependencies, which can exist between two relations. The inference rules help deduce these new
dependencies from a given set of functional dependencies, F. the set of dependencies, which cannot be
specified, is called the cosure of F and is denoted by F+. Following are the six inference rules of
functional dependencies F:
(a) IR1 (Reflexive rule): If X ⊇ Y, then X → Y: Yhis rule states that if X ⊇ Y and two tuples t1 and
t2 exist in a relation instance r of relation R such that t1 [X] = t2 [X]. Now, t1 [X] = t2 [X], because
X ⊇ Y. this implies that X → Y holds true in relation instance r of relation R.
(b) IR2 (augmentation rule): { X→ Y} |= XZ → YZ: this rule states that if X → Y holds true in a
relation instance r of R but XZ → YZ does not exist, then tuple t1 and t2 must exist in relation R.
(c) IR3 (transitive rule): { X → Y, Y → Z) |= X → Y: this rule states that if both X → Y and Y →
Z, hold true in a relation r, then for any two tuples t1 and t2 in r, must have t1[Y] = t2[Y].
(d) IR4 (decomposition or projective rule): This rule states that if X→YZ holds true, then X→Y
and X→Z also hold true.
(e) IR5 (Union or additive rule): This rule statest that if X→Y and X→Z hold trule, then in the
relation R, X →YZ also holds true.
(f) IR6(pseudotransitive rule): This rule statest that if X→Y and WY → Z hold true, then WX→Y
also holds true.
Attribute Closure: To comopute the closure J+ of a given set J of functional dependencies, we can
apply the inference rules until they stop producing new functional dependencies. We can use the
following algorithm to compute the closure J+.
result := J
while (changes to result) do
for each functional dependency B→Y
in F do
begin
if B ⊆ result;
then result := result UY
end

1NF: A table is in 1NF if the data in the table has an identifying key and does not include repeating
groups of data. To reduce data redundancy by using 1NF, we need to: (a) Remove the duplicate columns
from the table (b) Create a separate table for related data and identify the primary key in the table.
Requirements of 1NF: (a) Eliminate the multi-valued fields from the table (b) Each column in the table
must be atomic (c) Each column in the table must have a key such as primary key or foreign key (d)
Remove the repeated information form the table.
Partial Dependency: In a table, a primary key consist of one or more than one column to uniquely
identify each row in the table. Partial dependency occurs when a row of a table is uniquely identified by
one column that constitutes a primary key without requiring the entire primary key to uniquely identify
the row.
2NF: A table is in 2NF if the table satisfies all the conditions of the first normal form and does not
cosist of any column that depends on only one part of the identified primary key. It is based on the
concept of full dependency. To apply 2NF we need to: (a) ensure that the table conforms 1NF (b) Create
a separate table for sets of values that apply to multiple records (c) Relate these tables with a foreign
key.
Transitive Dependency: Transitive dependency occurs when a non-key column is uniquely identified
by values in another non-key column of a table.
3NF: A table is in 3NF if the table satisfies the requirements of 2NF and the non-key columns are
functionally dependent on only the primary key. It is based on the concept of transitive dependency. A
functional dependency, A→B, in a relation R is a transitive dependency in the following conditions are
satisfied: (a) A column or set of columns, C, exists in the table that is neither the candidate key of R nor
the subset of any key of R. (b) The functional dependencies A→C and C→B hold in the table.
BCNF: BCNF is stricter than the third normal form. In bcnf, the relation which is in BCNF is also
present in 3NF, but the relation present in 3NF is not necessary be present in BCNF. In 3NF, anomalies
can occur, when a relation has more than one candidate key. In case of overlapping of candidate keys,
3nf is unable to stop the occurances of anomalies. This provides a base for BCNF.
Decomposition: Properties of Decomposition: (a) Attribute Preservation: It involves preserving all
the attributes of the relation, which is being decomposed by the design algorithms. While decomposing
a relation, you need to make sure that each attribute in R exists in at least one relation schema Ri while
decomposing the relation.
(b) Lossless-join decomposition: it ensures that the join remains in the same relation, as it was before
the decomposition of the relation. The decomposition of the relation R into several relations, R1, R2,
…., Rn is called a lossless-join decomposition, if the relation r is the natural join of the relations R1, R2,
…., Rn.

You might also like