Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / General DB Topics / General DB Topics / August 2004

Tip: Looking for answers? Try searching our database.

Foreign key questions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phil Latio - 26 Aug 2004 06:55 GMT
1. Is it bad design to have a table with two foreign keys that reference the
same table? For example a football player transfer table which would have
columns for both the leaving and joining club.

2. Are there any other methods of referencing other than foreign keys and
using SELECT statements to ensure data integrity? For example with SELECT
statements, a form with list box prefilled so only values matching that
statement appear.

Cheers

Phil
John - 26 Aug 2004 08:44 GMT
> 1. Is it bad design to have a table with two foreign keys that reference the
> same table? For example a football player transfer table which would have
> columns for both the leaving and joining club.

No.

> 2. Are there any other methods of referencing other than foreign keys and
> using SELECT statements to ensure data integrity? For example with SELECT
> statements, a form with list box prefilled so only values matching that
> statement appear.

You should enforce integrity wherever you can. I would /aim/ to create
constraints in the database to ensure that it is impossible for the
front end (your list boxes etc) to make a mess of it. I would also /aim/
to design the front end such that it is impossible for the user to cause
rubbish to be passed to the database. If you get reasonably to close to
both your objectives, your data is likely to stay in fairly good order,
and the user will experience few errors and little confusing behaviour.

> Cheers
>
> Phil
Tony - 26 Aug 2004 14:06 GMT
> 1. Is it bad design to have a table with two foreign keys that reference the
> same table? For example a football player transfer table which would have
> columns for both the leaving and joining club.

No, it is good design.

> 2. Are there any other methods of referencing other than foreign keys and
> using SELECT statements to ensure data integrity? For example with SELECT
> statements, a form with list box prefilled so only values matching that
> statement appear.

No, you are confusing integrity constraints (foreign keys) with the
user interface  (list boxes).  You may well want to provide list boxes
in your application, but should still have the constraints in the
database as well.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.