3 answers

Hi Adam Primary key and Foreign key are relational database concepts. It is use to relate one table information to another for example I want to store employes and company details in my database so If I create a table and create column like emp name, emp contact, Company Name, Company address then there is data duplication I have to enter same value for Company Name and Company address. If company address is changed then I have to update all records field. This is not a proper database structure and it will have data duplication.To avoid this there is a concept of Primary and Foreign key in this I will create a separate table for company details and emp details.My company details will have a unique key Like Company Id which enforces the entity integrity of the table and will help me to connect with other records in different table. My another table Emp Detail will have a column which column called Company Id which is used to connect to table reords . In master details relationship master table Id field is Primary key and master detail field in detal table is Foreign key.You can find more onhttps://developer.salesforce.com/docs/atlas.en-us.fundamentals.meta/fundamentals/adg_database_concepts_relational.htmThanks and Regards,Ajay RAwat