Watch Our YouTube Channel
It is currently Mon Jan 22, 2018 10:35 am
 

All times are UTC



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Jun 27, 2016 5:59 am 
Offline

Joined: Fri Nov 13, 2015 3:56 am
Posts: 460
Relationship establishes a connection between a pair of tables that are logically related to each other. A pair of tables is logically related via the data each contains.

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

Relationships allow relational databases to split and store data in different tables, while linking disparate data items.

A relationship works by matching data in key columns, usually columns with the same name in both tables.

There are three types of relationships between tables. The type of relationship that is created depends on how the related columns are defined.
One-to-Many Relationship
Many-to-Many Relationships
One-to-One Relationships

A one-to-many relationship is the most common type of relationship. In this type of relationship, a row in table A can have many matching rows in table B, but a row in table B can have only one matching row in table A.

In a many-to-many relationship, a row in table A can have many matching rows in table B, and vice versa. You create such a relationship by defining a third table, called a junction table, whose primary key consists of the foreign keys from both table A and table B.

In a one-to-one relationship, a row in table A can have no more than one matching row in table B, and vice versa. A one-to-one relationship is created if both of the related columns are primary keys or have unique constraints.

A properly defined relationship ensures relationship-level integrity, which guarantees that the relationship itself is reliable and sound.

_________________
Learn Web Development | Latest Technology News |Motivational Quotes


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 20, 2016 11:28 am 
Offline

Joined: Wed Jul 01, 2015 11:28 am
Posts: 172
Location: Bangalore
In most cases, these matching fields are the primary key from one table, which provides a unique identifier for each record, and a foreign key in the other table. A foreign key (FK) is a column or combination of columns used to establish and enforce a link between the data in two tables.

_________________
Digital Marketing Company in India| Web Design Company in India | SEO Services in India


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron