Re: outer join between parent-child, not null and FK constraints

From: David Fitzjarrell <oratune_at_yahoo.com>
Date: Fri, 25 Jan 2013 11:11:25 -0800 (PST)
Message-ID: <1359141085.98618.YahooMailNeo_at_web121604.mail.ne1.yahoo.com>



The child table must have an entry from the parent table but that does NOT automatically mean that every PARENT has a child.  The outer join still has work to do.

David Fitzjarrell



From: amonte <ax.mount_at_gmail.com>
To: David Fitzjarrell <oratune_at_yahoo.com> Cc: Oracle-L Group <oracle-l_at_freelists.org> Sent: Friday, January 25, 2013 12:02 AM
Subject: Re: outer join between parent-child, not null and FK constraints

Hi David

As you say outer join returns all values from one table even there are no matches.

In a parent child relation ship all child must have a parent (unless the child tabla rows has a null for FK). If the FK is enforced a NOT NULL then the child table must have a value pointing to a parent correct? What I am saying is that if we have FK plus NOT NULL then all child must have a match in parent table so outer join with parent table is redundant because there is no way a child table wont match a parent row.

Unless I am missing some situation that even with FK and NOT NULL there wont be matches between child and parent?

Alex

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Jan 25 2013 - 20:11:25 CET

Original text of this message