What are the various relationships that can exist between database tables? Explain them [Hint - One-to-one relationship, One-to-many and Many-to-many]One-to-One: Depicts that one instance of entity A is and can be only related to one instance of entity B. e.g.: Student->Class (One-to-One) This means that one student can belong to only one class.
One-to-Many: Depicts that one instance of entity A can be related to one or more instances of entity B. e.g.: Class->Student (One-to-Many) This means that one class can have many students.
Many-to-Many: Depicts that one or more instances of entity A can be related to one or more instances of entity B. e.g.: Teacher->Student (Many-to-Many) This means that one teacher can have many students and a single student can have many teachers.
|