際際滷

際際滷Share a Scribd company logo
Muhammad Umair
Oracle Database 11g Developer Track
 A mathematical definition:
 if A, B are sets, then a relation R is a subset of A x B
 A={1,2,3}, B={a,b,c,d},
R = {(1,a), (1,c), (3,b)}
- makes is a subset of Product x Company:
1
2
3
a
b
c
d
A=
B=
makes Company
Product
 Relationship
 Relationship is defined as a meaningful association among instance
of one or more entities.
 E.g. Students reads for degree, Students passes course, Teacher
serve department.
 Degree of Relationship
 Number of entities involved in a relationship
 Types of Relationship
 Unary Relationship
A relationship among instance of single entities
 Binary Relationship
A relationship among instance of two entities
 Ternary Relationship
A relationship among instance of three entities.
 Maximum Cardinality
 If and b are two associated entities then maximum cardinality of A
will be the maximum number of instance of A that can be
associated with a single instance of B.
 Maximum cardinality can be either one or many
 Minimum Cardinality
 If and b are two associated entities then minimum cardinality of A
will be the minimum number of instance of A that can be
associated with a single instance of B.
 minimum cardinality can be either zero or one
 Types of Relationship on the basis of Maximum Cardinality
 One-to-One Relationship
 A relationship having cardinality one on both sides
 One-to-Many Relationship
 A relationship having cardinality one on one side and many on other side
 Many-to-Many Relationship
 A relationship having cardinality many on both sides
 one-one:
 many-one
 many-many
1
2
3
a
b
c
d
1
2
3
a
b
c
d
1
2
3
a
b
c
d
address name ssn
Person
buys
makes
employs
Company
Product
name category
stockprice
name
price

More Related Content

Relationships

  • 1. Muhammad Umair Oracle Database 11g Developer Track
  • 2. A mathematical definition: if A, B are sets, then a relation R is a subset of A x B A={1,2,3}, B={a,b,c,d}, R = {(1,a), (1,c), (3,b)} - makes is a subset of Product x Company: 1 2 3 a b c d A= B= makes Company Product
  • 3. Relationship Relationship is defined as a meaningful association among instance of one or more entities. E.g. Students reads for degree, Students passes course, Teacher serve department. Degree of Relationship Number of entities involved in a relationship Types of Relationship Unary Relationship A relationship among instance of single entities
  • 4. Binary Relationship A relationship among instance of two entities Ternary Relationship A relationship among instance of three entities. Maximum Cardinality If and b are two associated entities then maximum cardinality of A will be the maximum number of instance of A that can be associated with a single instance of B. Maximum cardinality can be either one or many
  • 5. Minimum Cardinality If and b are two associated entities then minimum cardinality of A will be the minimum number of instance of A that can be associated with a single instance of B. minimum cardinality can be either zero or one Types of Relationship on the basis of Maximum Cardinality One-to-One Relationship A relationship having cardinality one on both sides One-to-Many Relationship A relationship having cardinality one on one side and many on other side Many-to-Many Relationship A relationship having cardinality many on both sides
  • 6. one-one: many-one many-many 1 2 3 a b c d 1 2 3 a b c d 1 2 3 a b c d