Re: Schema Anomalies
- From: "John Currier" <md4curvs@xxxxxxxxx>
- Date: 5 Sep 2005 10:16:13 -0700
DM Unseen wrote:
> Some foreign keys column names can be tricky.
>
> given a table Contact with a PK ContactID and a Investor's table that
> has a MTO relation to table Contact
>
> The foreign key could look like this:
>
> "Investor ContactID" ->Contact.ContactID
> or
> Investor2Contact -> Contact.ContactID
> or
> Investor_ContactID -> Contact.ContactID
> or
> InvestorContactID -> Contact.ContactID
I'm not exactly sure what you're trying to say here. Is this in
reference to the implied relationships anomaly? If so then you are
correct that it would not detect these relationships, but I don't think
that there would be a way to detect them if there's no foreign key
defined. Note that the implied relationships anomaly was the first one
that I added. I've seen this problem in several production databases
where someone just forgot to add the foreign key.
> Tables that contain a single column are OK provided there is a unique
> constraint/index/PK on the column.
Any of these things might be OK for a given schema. In one of our
schemas they were using a separate single column table for each type to
identify type information. This questionable design led to some
extremely nasty SQL.
What would be a valid/appropriate use of a single column table?
> A good addition would be relation analisys: so deriving OTM/MTO and
> OTOP/OTOF relations from the actual schema.
Yes, I've thought about adding that, but am unsure as to how to present
that information. I'll have to experiment with that a bit.
> Also recognizing
> intersection tables (MTM) would be very nice(intersection tables only
> consist of foreign keys, although some of them might even have a unique
> index/constraint)
That shouldn't be too difficult. Which term, intersection table or
junction table, is more accepted/appropriate?
Thanks,
John Currier
http://schemaspy.sourceforge.net
.
- Follow-Ups:
- Re: Schema Anomalies
- From: DM Unseen
- Re: Schema Anomalies
- References:
- Schema Anomalies
- From: John Currier
- Re: Schema Anomalies
- From: DM Unseen
- Schema Anomalies
- Prev by Date: Re: Best way to get key of serial type for later use?
- Next by Date: Re: Best way to get key of serial type for later use?
- Previous by thread: Re: Schema Anomalies
- Next by thread: Re: Schema Anomalies
- Index(es):
Relevant Pages
|
|