Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Data modeling question

Data modeling question

From: Thomas Jeff <jeff.thomas_at_thomson.net>
Date: Wed, 11 May 2005 07:37:43 -0500
Message-ID: <428BC948616D534DA0860EDF33F542AB17A589@INDYSMAIL02.am.thmulti.com>


I was wondering if there was an elegant way to model (or implement the business rule)=20
for those situations where the requirement in a parent-child relationship is such=20
that there a quantity restriction on the child table. =20

Consider the following two tables:

Table A            Table B
DB_NAME            DB_NAME
SCHEMA_NAME        SCHEMA_NAME
                   USR_ID          -- user (authority)
                   AUTH_INDICATOR  -- change authority
                   USR_INDICATOR   -- user authority

In a nutshell, the rule is that there can be no more than 3 change or user
authorities for the given database/schema. A given user can be either or both a change=20
and user authority for a specific database/schema, and can be an authority for multiple
database/schemas. So, given the model/business rule, there could be anywhere from 3=20
to 6 child records for a given database/schema.

When first presented with this model, my initial thought was to add a shadow table to Table B,=20
using before triggers to implement the business rules, and after triggers to maintain the=20
shadow table.=20

I'm sure this problem has cropped up before and would appreciate knowing how you implemented
such a requirement.

Thanks.



Jeffery D Thomas
DBA
Thomson Information Services
Thomson, Inc.

Email: jeff.thomas_at_thomson.net

Indy DBA Master Documentation available at: http://gkmqp.tce.com/tis_dba


--
http://www.freelists.org/webpage/oracle-l
Received on Wed May 11 2005 - 08:42:16 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US