Hi All,
i have confusing little here..what is the actual use of foriegn key an primary key relations .can we bind the date using this relation only...if we want records from both tables which contains PK andFK relation any way we use joins .then what is actuall use of these. can any one explain me with real time example

Francis SusaimichaelRank #466 · 5.4K reputationPosted Jul 25, 2016, 12:08 AM EDT
In real time, what is the relationship abouta boy andanother man in the same family? Can you guess it. Nope. because it may be Son & father orgrandson& father etc.So the "relationship" definesit. So you name it at least to define. This is where the "relationship" will come. Normally a primary key, isavailable inside a Table. If you want to relate the 2 tables Foreign key comesto picture.
Nitin SontakkeRank #264 · 9.6K reputationPosted Jul 25, 2016, 7:42 PM EDT
I understand your confusion. You are saying if I can get data from joining the keys what bother defining the keys.
However, as Francis already mentioned, PK and FK work as a constraints. Meaning, you cannot insertNULL in a PK column and you cannot insert duplicate value in PK column. Similarly, while you can insert NULL in FK column (if it is nullable) you cannot insert a value in a FKcolumn which is not present in PK column in another table to which FK column references.
kalu singh raoRank #884 · 2.4K reputationPosted Jul 25, 2016, 12:14 AM EDT