TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
tri_inn
NA
1.2k
235.2k
Why primary & foreign key is required for database table
Mar 2 2015 4:10 AM
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
Reply
Answers (
3
)
how to send auto email from mysql
How to Convert MSSQL Db to MySQL Db?