70 likes | 215 Views
Entities and Attributes. Entity is a noun (or thing that data is being collected about)E.g. students, customers, parents, order, products, etc. An attribute is a property associated with the entities E.g. a student has: name, address, date of birth etc.Each of these help to describe the student
E N D
1. MIS 6322 Database Relationships
2. Entities and Attributes Entity is a noun (or thing that data is being collected about)
E.g. students, customers, parents, order, products, etc.
An attribute is a property associated with the entities
E.g. a student has: name, address, date of birth etc.
Each of these help to describe the student in question.
3. One entity in the first table can only be related to one entity in the other table.
An employee has one spouse
A spouse is associated with only one employee One-to-One (1:1) Relationships
4. One-to-Many (1:M) Relationships One entity in the first table can only be related to one entity in the other table.
5. Many-to-Many (M:N) Relationships One entity in the first table can only be related to one entity in the other table.
6. Degree of Relationship Degree
Number of entity types that participate in a relationship
Three cases
Unary
A relationship between two instances of one entity type
Binary
A relationship between the instances of two entity types
Ternary
A simultaneous relationship among the instances of three entity types
Not the same as three binary relationships
7. Example relationships of different degrees
8. Functional Dependencies and Primary Keys Foreign Key
An attribute that appears as a nonprimary key attribute in one relation and as a primary key attribute (or part of a primary key) in another relation
Referential Integrity
An integrity constraint specifying that the value (or existence) of an attribute in one relation depends on the value (or existence) of the same attribute in another relation