SunQuest
 
       Administration
  Home arrow Administration arrow Page 4 - Database Essentials
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ADMINISTRATION

Database Essentials
By: icarus, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 7
    2001-02-26

    Table of Contents:
  • Database Essentials
  • The Customer Is King
  • Relationships
  • Invasion Of The Foreign Keys
  • Looking Up The Index
  • Joined At The Hip
  • Room With A View
  • Pulling The Trigger
  • So That's Where All My Money Went...

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Database Essentials - Invasion Of The Foreign Keys


    (Page 4 of 9 )

    You will notice that it is the CustomerID field, which appears in all three of the tables, that makes it possible to link different tables together. In such a case, the CustomerID field is also referred to as a "foreign key", since it is used to refer to records in different tables. In the example above, the name of the foreign key field is the same for all tables; this is not necessary at all times.

    When each and every foreign key value is related to a field in another table, this relationship being unique, the system is said to be in a state of "referential integrity". In other words, if the CustomerID field is present in all the tables once and only once, and if a change to the CustomerID field in any single table is reflected in all other tables, referential integrity is said to exist.

    This concept of referential integrity is a basic one, and one that becomes very important when designing a database with more than one table. When foreign keys are used to link one table to another, referential integrity, by its very nature, imposes constraints on inserting new records and updating existing records. For example, if a table only accepts certain types of values for a particular field, and other tables use that field as their foreign key, this automatically imposes certain constraints on the dependent tables. Similarly, referential integrity demands that a change in the field used as a foreign key - a deletion or new insertion - must immediately be reflected in all dependent tables.

    Many of today's databases take care of this automatically - if you've worked with Microsoft Access, for example, you'll have seen this in action - but some don't. In the case of the latter, the task of maintaining referential integrity falls to the application developer, by manually updating all dependent tables to reflect changes in foreign key values.

    More Administration Articles
    More By icarus, (c) Melonfire


     

       

    ADMINISTRATION ARTICLES

    - Network Administration with FreeBSD 7
    - Components of an Information Architecture
    - The Anatomy of an Information Architecture
    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization
    - Advanced Concepts on Dealing with Files and ...
    - Dealing with Files and Filesystems





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway