Unix Technical Forum

Foreign Keys - advantage ?

This is a discussion on Foreign Keys - advantage ? within the MySQL forums, part of the Database Server Software category; --> As a newbie to SQL I guess the only advantage I can see of setting up Foreign Keys is ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 10:12 AM
NA news
 
Posts: n/a
Default Foreign Keys - advantage ?

As a newbie to SQL I guess the only advantage I can see of setting up
Foreign Keys is to help ensure you don't get left with 'orphan' rows, right
?
TIA,
Nick A


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 10:12 AM
Paul Lautman
 
Posts: n/a
Default Re: Foreign Keys - advantage ?

NA news wrote:
> As a newbie to SQL I guess the only advantage I can see of setting up
> Foreign Keys is to help ensure you don't get left with 'orphan' rows,
> right ?
> TIA,
> Nick A


Things like "cascade on delete" save programming


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 10:12 AM
Robert Klemme
 
Posts: n/a
Default Re: Foreign Keys - advantage ?

On 20.02.2007 22:09, Paul Lautman wrote:
> NA news wrote:
>> As a newbie to SQL I guess the only advantage I can see of setting up
>> Foreign Keys is to help ensure you don't get left with 'orphan' rows,
>> right ?
>> TIA,
>> Nick A

>
> Things like "cascade on delete" save programming


.... and make the DB maintain consistency automatically.

robert
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:01 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com