Saturday, December 1, 2012

DataBase Fundamentals



Many –to-many relationships can be resolved by inserting a third entity known as intersection entity.The created third entity is DrivenVehicle.Driven vehicles are many but a specific driver and specific vehicle is driven at an instance of time.Driver’s entity  primary key is driver’s driving license  which uniquely identifies the driver.The primary key for a vehicle is its number plate which uniquely identifies a particular automobile..We can use these two  primary keys from the Driver and Vehicle  entities as foreign keys  and unique keys in DrivenVehicle entity to uniquely identify the driver and particular vehicle.
When the status of a DrivenVehicle entity  is on, we can identify the driver and the car.
Many–to-many relationship is now reduced to two  one-to-many  relationship which can be easily resolved.