File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between foreign key & Join

 
Bandita Patel
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When to use "foreign key"? if we are getting the same result by using "Joins" then why should we use foreign key?
 
Satya Maheshwari
Ranch Hand
Posts: 368
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bandita rani wrote:When to use "foreign key"? if we are getting the same result by using "Joins" then why should we use foreign key?

Foreign keys are used for joining.
 
Bandita Patel
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya thats what i want to ask.. whats the difference then?
 
Ireneusz Kordal
Ranch Hand
Posts: 423
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bandita Acharya wrote:When to use "foreign key"? if we are getting the same result by using "Joins" then why should we use foreign key?


Foreign key primary role is to enforcing referential integrity between data in two tables, not joining.
Here you find the basics: http://en.wikipedia.org/wiki/Foreign_key
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic