Another scenario that will not work in a multiuser environment. Seems like a case for an on-commit fast refresh materialized view defined as …
Select COUNT (*) num_rows
Where relationship = ‘friend’
having count(*) > 2;
Place a check constraint on num_rows to say 1=0 and there you go … multiuser compatibility for a multirow constraint.