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

  • From: David Fitzjarrell <oratune@xxxxxxxxx>
  • To: amonte <ax.mount@xxxxxxxxx>
  • Date: Fri, 25 Jan 2013 11:11:25 -0800 (PST)

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@xxxxxxxxx>
To: David Fitzjarrell <oratune@xxxxxxxxx> 
Cc: Oracle-L Group <oracle-l@xxxxxxxxxxxxx> 
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
--
//www.freelists.org/webpage/oracle-l


Other related posts: