Database - The Relational Model and Normalization - Discussion
Discussion Forum : The Relational Model and Normalization - General Questions (Q.No. 9)
9.
In the relational model, relationships between relations or tables are created by using:
Discussion:
6 comments Page 1 of 1.
Prabhat said:
9 years ago
Primary key only accept unique value and not null value but foreign key accept duplicate value and null value.
(1)
Anbu.M said:
1 decade ago
Foreign key is used to find the relationship between two attributes or tables.
Naresh said:
1 decade ago
Can you tell me the difference between primary key & foreign key?and where can we use them?
Sai said:
1 decade ago
It is between two different tables. That's why a foreign key is used.
VIKASH KUMAR SHAW said:
1 decade ago
If any set of attributes of one table behaves as primary keys in another tables then that set of attributes are foreign keys w.r.t the another tables. Always remember one table can contain only one primary key which is set by DBA (Database administrator). So according to my view it may be that there should not be more than one foreign key in any table/relation.
Since, the relationship set makes the relation among the different entity sets so for the relationship table there must be some fields which reference the different entity tables one by one and also some different fields. It means that some fields of the relationship set acts as the primary keys in the different entity sets so these fields are the foreign keys w.r.t. The tables which is referenced by that fields of the relationship tables. So it is clear that,
In the relational model, relationships between relations or tables are created by using:
Answer: Foreign keys.
Since, the relationship set makes the relation among the different entity sets so for the relationship table there must be some fields which reference the different entity tables one by one and also some different fields. It means that some fields of the relationship set acts as the primary keys in the different entity sets so these fields are the foreign keys w.r.t. The tables which is referenced by that fields of the relationship tables. So it is clear that,
In the relational model, relationships between relations or tables are created by using:
Answer: Foreign keys.
Anil kumar said:
1 decade ago
Foreign key is the reference key between two table or relation. A primary key is used as a foreign key in the other relation.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers