Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Post
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Reply
Why primary & foreign key is required for database table
tri_inn
9 years ago
645
Reply
we know that when we create pk on any table then a cluster index is created and pk do not allow null and duplicate value. so instead of pk we can create unique key on a fields then cluster index will be created and duplicate data will not be inserted. it would be helpful if some one discuss briefly why pk is required and its advantage.
the same way when we have table called employee and employee_details and both have same field called empid and when we create relation from sql server diagram then automatically a fk will be created on employee_details table but i like to know if we do not create fk on employee_details table then we also can join two table for fetching data. so my question is if we can join 2 table to fetch data without fk then what is importance of fk and what will be the advantage of fk.
it will be helpful if some one discuss my points in details example for better understanding. thanks
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
how to send auto email from mysql
How to Convert MSSQL Db to MySQL Db?