Professional Documents
Culture Documents
INFORMATION, COMMUNICATION
AND
TECHNOLOGY
Submitted By:
Name: Taruun R Malik
Roll no. : 04916401521
Class: B.Tech(IT-3rd Semester)
Batch: 2021-2025
S.No. Objective Date
Draw an ER Diagram along with necessary
1. DFDs for the assigned database i.e. Company
Insurance Database.
Draw an ER Diagram along with necessary DFDs for the assigned database i.e. Company
Insurance Database.
As tables are currently empty, we shall view them using DESCRIBE command on mysql.
PRACTICAL-3
On tables perform queries : i) Inserting/Updating Records ii)Deleting Records
i)Insertions:
Values can be inserted in a table anytime, but the constraint is if a particular value is not set by default at the time of
creation and still left empty will result in an error.
ii) Deletions:
Entries/Tuples can be deleted any time using the DELETE command, but if no such tuple exists an error would be
thrown.
Here are the same tables as before after deleting one row from each.
PRACTICAL-4
On tables perform aggregate functions: i) Order By Clause ii)Group By Clause
i) Order by:
The ORDER BY keyword is used to sort the result-set in ascending or descending order.
ii)Group by:
The GROUP BY statement is often used with aggregate functions (COUNT(), MAX(), MIN(), SUM(), AVG()) to group the result-set by one or more
columns.
PRACTIAL-5
On tables perform queries: i) Saving(Commit) ii)Undoing(Rollback) iii)JOINS on tables
b) Right join:
The RIGHT JOIN keyword returns all records from the right table (table2), and the matching records (if any) from the left table
(table1).
c) Inner join:
The INNER JOIN keyword selects records that have matching values in both tables.
d) Cross join:
The CROSS JOIN keyword returns all records from both tables (table1 and table2).
PRACTICAL-6
On tables perform queries: i) Altering table ii)Renaming table iii)Truncate and Date functions
The ALTER TABLE statement is used to add, delete, or modify columns in an existing table.
While working with database, the format of the date in table must be matched with the input date in order to insert.
In various scenarios instead of date, datetime (time is also involved with date) is used.
Here, when a new tuple is inserted our ‘setInsurance’ trigger is called which sets the value of ‘insurance_status’ to
‘claimed’.
PRACTICAL-9
NORMALIZATION OF TABLES:
1NF-FIRST NORMAL FORM:
Tables created for the objective of an ‘Insurance Company’ Database are all 1NF normalized as none of the tuples
have redundancy and atomicity is carefully preserved.
Car table:
Accident Table:
To show the concept of 2NF, Car table was used. ‘Year’ attribute was able to partially describe ‘Damage Amount’
attribute i.e. ‘DamageAmt’ was partially dependent on ‘Year’ so, ‘Car’ table was divided into two sub-tables:
‘2NFCarLeft’ and ‘2NFCarRight’
2NFCarLeft Table:
2NFCarRight Table:
Thus, 2NF form of normalization was depicted using ‘Car’ Table. As none of the tuples in ‘Car’ table were repeated
and each cell had one value only, it was obvious that the table was already 1NF normalized.
--A relation is in 3NF if at least one of the following condition holds in every non-trivial function dependency X –> Y:
1. X is a super key.
All of the tables were already 3NF normalized as none of the tables had transitive dependency and were all 2NF
normalized. Take ‘Accident’ table for example, here ‘reportID’ attribute can determine all the remaining
attributes. Example, date can be determined by reportID itself, location can be determined by reportID, even
damageAmt can be determined by reportID.
BCNF:
--A relation is in BCNF, if and only if, every determinant is a Form (BCNF) candidate key.
To show BCNF normal form, a new table was created and it was named ‘StudentAndProfessor’
One subject may be taught by multiple professors. This shows that there is a dependency between the subject & the
professor, and the subject is always dependent on the professor (professor -> subject). This is not allowed in BCNF
in DBMS. For BCNF, the deriving attribute (professor here) must be a prime attribute.
To satisfy BCNF, we would divide this table in two different tables where professorID would be a primary key.