Answer:
Check the explanation
Explanation:
(1.) The functional dependencies based on assumptions are as follows:-
Trip determines which staff was there in the trip, the car used for the trip, the quantity of fuel used in the trip, the fill up time and the total paid of the trip.
Service station refers to its address
Car details consist of the details of license plate, odometer reading and the fuel type used in the car
fuel type and the fill up time will help to determine the cost of the fuel at that time
cost of the fuel and the quantity of fuel used will determine the total paid
From the above assumptions the functional dependencies are as follows:-
Trip ID -> Staff Name, Car Details, Service Station, Quantity, Fill Up Time, Total Paid
Service Station -> Station Address,
Car Details -> License Plate, Odometer reading, Fuel Type
Fuel Type, Fill up Time -> Cost per litre
Cost per Litre, Quantity -> Total Paid
(2.) Initially the relation is as follows:-
R (Trip ID, Staff Name, Car Details, License Plate, Odometer Reading, Service Station, Station Address, Fill up Time, Fuel type, Quantity, Cost per Litre, Total Paid)
For 1 NF there should not be composite attributes,in the above relation Staff Name and Station Address are composite attributes therefore it will be decomposed as follows:-
R (Trip ID, Staff First Name,Staff Last Name, Car Details, License Plate, Odometer Reading, Service Station, Street, City, State, Zip Code, Fill up Time, Fuel type, Quantity, Cost per Litre, Total Paid)
For 2 NF there should not be partial dependency that is non prime attribute should not dependent upon any 1 prime attribute of candidate key, since in the given relation there is only 1 candidate key which is only Trip ID, therefore the relation is already in 2 NF.
For 3 NF there should not be transitive dependency that is non prime attribute should not dependent upon the other non prime attribute, if it is present then the relation will be decomposed into sub relations, the given relation is not in 3 NF therefore it will be decomposed as follows:-
R1 (Trip ID, Staff First Name, Staff Last Name, Car Details, Service Station, Quantity, Fill up time, Total paid)
R2 (Service Station, Street, City, State, Zip Code)
R3 (Car Details, License Plate, Odometer reading, Fuel Type)
R4 (Fuel Type, Fill up Time, Cost per litre)
R5 (Cost per Litre, Quantity, Total Paid)
(3.) After the 3 NF we add the primary and foreign key constraints as follows:-
R1 (Trip ID, Staff First Name, Staff Last Name, Car Details, Service Station, Quantity, Fill up time, Total paid)
R2 (Service Station, Street, City, State, Zip Code)
R3 (Car Details, License Plate, Odometer reading, Fuel Type)
R4 (Fuel Type, Fill up Time, Cost per litre)
R5 (Cost per Litre, Quantity, Total Paid)
In the above relational schema the primary keys are represented with bold and foreign keys by italic
(4.) The ER diagram of the above relational schema using crow's foot notation are as shown in the attached image below:-