database relatinship

9

Upload: zishan-yousaf

Post on 26-Jan-2015

102 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Database relatinship
Page 2: Database relatinship

Relational database matches data by using common characteristics found within the data set.

Page 3: Database relatinship

Primary keys

Foreign keys

Relationship Types

Page 4: Database relatinship

The primary key of a relational table uniquely identifies each record in the table.

It can either be a normal attribute that is guaranteed to be unique (such as Roll No in a student Table or Employee Number in Employee Table)

Page 5: Database relatinship

A foreign key is a field in a relational table that matches the primary key column of another table.

The foreign key can be used to cross-reference tables.

Page 6: Database relatinship

A relationship exists between two database tables when one table has a foreign key that references the primary key of another table.

Page 7: Database relatinship

One-to-one: Occur when there is exactly one record in TableA that corresponds to exactly one record in TableB.

One-to-many: Occur when each record in TableA may have many linked records in TableB but each record in TableB may have only one corresponding record in TableA.

Many-to-many: Occur when each record in TableA may have many linked records in TableB and vice-versa.

Page 8: Database relatinship
Page 9: Database relatinship