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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Data Normalization & Working with Views

Re: Data Normalization & Working with Views

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Fri, 3 Jun 2005 17:21:08 -0400
Message-ID: <peCdnUofEr1bVD3fRVn-qw@comcast.com>

"Chris" <ctaliercio_at_yahoo.com> wrote in message news:1117831348.061879.109470_at_g44g2000cwa.googlegroups.com...
> I'm working with ORacle 10g on HP-UX 11i. I am relatively new to data
> normalization (the previous database I was working with was a complete
> nightmare of replicated information) and working with views, so please
> bear with my ignorance here.
>
> If you have two tables:
>
> FIRSTNAME (
> ID INTEGER,
> NAME VARCHAR2(10),
> LASTNAME_ID INTEGER ) -+
> |
> and |
> |
> LASTNAME ( |
> ID INTEGER, -+
> NAME VARCHAR2(10) )
>
> Where FIRSTNAME has a foreign key relationship established with
> LASTNAME based on ID.
>
> And you define the following view:
>
> v_NAMES (
> SELECT
> FIRSTNAME.NAME,
> LASTNAME.NAME
> FROM
> FIRSTNAME, LASTNAME
> WHERE
> FIRSTNAME.LASTNAME_ID = LASTNAME.ID )
>
> How do you go about inserting new records into the view.
>
> Suppose I want to put "John Doe" into the view.
>
> I'm wondering how one goes about this from a programming standpoint.
> Obviously this is a very simplified/quickly thrown together example,
> but I'm looking to understand the basic concept here.
>
> Any and all help is much appreciated.
>

You seem to be getting off on the wrong foot -- it's quite odd to have a separate tables of first and last names, more likely you have a PERSON table with either a 1:M self-referencing (hierarchical) or M:M self-referencing (associative) relationship. The issus of updating a view such as you are anticipating then goes away.

For data modeling, get and study these books:

David Hay -- Data Model Patterns: Conventions of Thought (ISBN: 0-932633-29-3)
David Barker -- Case*Method: Entity Relationship Modelling (ISBN: 0201416964 )

Also, look over some of the articles at Dave Hay's site: http://www.essentialstrategies.com/

++ mcs Received on Fri Jun 03 2005 - 16:21:08 CDT

Original text of this message

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