Professional Documents
Culture Documents
22MCA0077_VL2022230105109_DA
22MCA0077_VL2022230105109_DA
Digital Assignment - I
Normal forms are standards that are used to design and organise relational
database tables in a specific way to minimise redundancy and dependency. There
are several normal forms, including the first normal form (1NF), second normal form
(2NF), third normal form (3NF), and Boyce-Codd normal form (BCNF). Here is an
explanation of each normal form, along with a example:
1. First normal form (1NF):
A table is in 1NF if it meets the following criteria:
● The table has a primary key, which is a unique identifier for each
row in the table.
● Each column in the table contains a single value.
● There are no repeating groups of columns.
For example, consider the following table:
This table is in 1NF because it has a primary key (the "Customer ID" column), each
column contains a single value, and there are no repeating groups of columns.
1 1 101 2
2 1 102 1
3 2 101 3
4 3 102 2
5 3 103 1
This table is in 2NF because it is in 1NF (it has a primary key and each column
contains a single value) and all non-key columns are fully dependent on the primary
key (the "Customer ID" column).
This table is not in 3NF because there is a transitive dependency between the
"Department ID" and "Department Name" columns. Specifically, the "Department
Name" column is dependent on the "Department ID" column, which is in turn
dependent on the primary key ("Employee ID"). To put the table in 3NF, you would
need to split it into two separate tables: one for employees and one for departments.
4. Boyce-Codd normal form (BCNF) is a normal form in database design that is used
to eliminate redundancy and ensure that all dependencies in a table are full
functional dependencies (FDs).
A table is in BCNF if it meets the following criteria:
● The table is in 3NF.
● Every determinant (column that determines the value of another column) is a
candidate key (a column or set of columns that could be used as the primary
key of the table).
For example, consider the following table:
This table is not in BCNF because the "Department ID" column is a determinant for
the "Department Name" column, but it is not a candidate key (it cannot be used as
the primary key of the table). To put the table in BCNF, you would need to split it into
two separate tables: one for employees and one for departments.
For example, the following two tables would be in BCNF:
Employees table:
1 John Smith 1
2 Jane Doe 2
3 Bob Johnson 1
Departments table:
1 Marketing
2 Sales
In these tables, the "Employee ID" and "Department ID" columns are candidate keys
and there are no transitive dependencies between columns.
10
/ \
6 14
/\ /\
3 8 11 19
/\ /\ /\ / \
1 4 7 9 12 17 22
In this example, the root node contains the values 10, 6, and 14. The non-leaf nodes
contain pointers to the leaf nodes, which contain the actual data values (1, 4, 7, etc.).
The leaf nodes are linked together in a linked list, allowing for fast sequential access
to the data.
B+ trees are often used in DBMSs because they allow for fast insertion, deletion, and
searching of data, and they are efficient at using disk space. They are particularly
useful for large data sets that do not fit in main memory.
Parallel algorithms are algorithms that are designed to run on multiple processors or
computers simultaneously, in order to solve a problem faster than a single processor
or computer could. In a parallel database management system (DBMS), parallel
algorithms can be used to sort large data sets in parallel, taking advantage of the
multiple processors or computers available.
There are several types of parallel algorithms that can be used for sorting in a
parallel DBMS, including:
1. Bitonic sort: This is a comparison-based sorting algorithm that uses a
divide-and-conquer approach to sort a list of values. It can be implemented in
parallel by dividing the list into smaller sublists and sorting them in parallel.
2. Merge sort: This is a comparison-based sorting algorithm that uses a
divide-and-conquer approach to sort a list of values. It can be implemented in
parallel by dividing the list into smaller sublists, sorting them in parallel, and
then merging the sorted sublists together in parallel.
3. Quicksort: This is a comparison-based sorting algorithm that uses a
divide-and-conquer approach to sort a list of values. It can be implemented in
parallel by dividing the list into smaller sublists and sorting them in parallel.
4. Radix sort: This is a non-comparison-based sorting algorithm that sorts values
by their digits (from least significant to most significant). It can be
implemented in parallel by dividing the list into smaller sublists and sorting
them in parallel.
These are just a few examples of parallel algorithms that can be used for sorting in a
parallel DBMS. There are many other algorithms available as well, each with its own
strengths and weaknesses. The choice of which algorithm to use will depend on the
specific requirements of the application and the resources available in the DBMS.