Home > Ask the Oracle Experts > Database Design and Architecture Questions & Answers > How would referential integrity work in this situation?
Ask The Oracle Expert: Questions & Answers
EMAIL THIS

How would referential integrity work in this situation?

Brian Peasland EXPERT RESPONSE FROM: Brian Peasland

Pose a Question
Other Oracle Categories
Meet all Oracle Experts
Become an Expert for this site


Oracle tips, scripts, and expert advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


>
QUESTION POSED ON: 15 April 2008
Quick question about referential integrity:

Let's say I have 4 tables:

A table has NAME
B table has NAME, CODE
C table has CODE
D table has NAME, CODE, ELSE

A (NAME) is referenced by B (NAME) and C (CODE) is referenced by B (CODE)

If I reference B (NAME, CODE) from D, do I need to reference A (NAME) and C (CODE) as well (from D)?


>
EXPERT RESPONSE
You do not need to make the additional references. When designing your schema, so long as you can walk from one table to another, you are fine. However, I would make a minor change. The D table has NAME and CODE. I would have the A table reference the D table. I would have the B table reference the D table, and finally, I would have the C table reference the D table. I hope this makes sense. In some situations, it may make more sense to do it this way. The only situations I can think of are where the NAME values in A are a strict subset of what is in B and B contains a strict subset of what is in D. If you must enforce this type of relationship, then your referential integrity example is fine.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
Database Design and Architecture
Why am I getting the ORA-03113 error when trying to refresh a materialized view?
Receiving the ORA-01652 error with no specified tablespace
Why am I getting an Oracle error when issuing the RECOVER DATABASE command?
Can I add multiple datafiles and make use of all the temporary datafiles at the same time?
What's the best tape backup strategy for 10g RAC?
Checkpoint vs. commit process
How does an INSERT/UPDATE statement behave when executed compared to a SELECT statement?
Can I resize the SYSTEM tablespace?
What is the difference between an instance and mounting in Oracle?
How to implement a ref cursor called in a stored procedure

Oracle database administration (DBA)
ORA-27101 error: shared memory realm does not exist
How to set up a job for an SQL query in Oracle 10g Grid Control
Receiving the ORA-01652 error with no specified tablespace
Why am I getting the ORA-03113 error when trying to refresh a materialized view?
Hot backup when Oracle Database is up
ORA-06550 error when exporting a database
Why do I have to start my Oracle database manually?
Why am I getting an Oracle error when issuing the RECOVER DATABASE command?
Can I add multiple datafiles and make use of all the temporary datafiles at the same time?
Checkpoint vs. commit process
Oracle database administration (DBA) Research

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice

HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2003 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts