Home arrow Site Administration arrow Page 3 - Database Essentials

Relationships - Administration

Are you new to the wonderful world of databases? Confused by thesudden flood of technical jargon? Don't know the difference between a"trigger" and a "stored procedure", a "join" and a "subquery"? Look nofurther - the solution is right here!

TABLE OF CONTENTS:
  1. Database Essentials
  2. The Customer Is King
  3. Relationships
  4. Invasion Of The Foreign Keys
  5. Looking Up The Index
  6. Joined At The Hip
  7. Room With A View
  8. Pulling The Trigger
  9. So That's Where All My Money Went...
By: icarus, (c) Melonfire
Rating: starstarstarstarstar / 7
February 26, 2001

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
Many of today's databases are "relational database management systems", referred to by the acronym RDBMS. A relational database is typically composed of multiple tables, which contain inter-related pieces of information. SQL, or Structured Query Language, allows you to combine the data from these tables in different ways, thereby allowing you to create and analyze new relationships.

The example you just saw consists of a single table. While this is fine by itself, it's when you add more tables, and relate the information between them, that you truly start to see the power inherent in this system. Here's an example:

# "names" table
+------------+-----------+----------+
| CustomerID | FirstName | LastName |
+------------+-----------+----------+
|     234673 | John      | Doe      |
|     734736 | Julius    | Caesar   |
|       1243 | Daffy     | Duck     |
+------------+-----------+----------+
# "addresses" table
+------------+------------------------------+---------------+-------+--------+---------+
| CustomerID | StreetAddress                | City          | State | Zip    | Country |
+------------+------------------------------+---------------+-------+--------+---------+
|     234673 | 12, Some Street              | Nowheresville | ZZ    | 748202 |     56  |
|     734736 | The Palace Behind The Lake   | Ancient Rome  | NA    |      0 |       0 |
|       1243 | Next Door To The Rabbit Hole | Toontown      | TT    |  98765 |       0 |
+------------+------------------------------+---------------+-------+--------+---------+
# "balance" table
+------------+----------------+
| CustomerID | AccountBalance |
+------------+----------------+
|     734736 |     6546867.67 |
|     234673 |        3275.99 |
|       1243 |           3.00 |
+------------+----------------+


Each of these three tables is an independent entity; however, they can be linked to each other by means of the CustomerID field common to all of them. For example, you could easily use the CustomerID 1243 to find out that user "Daffy Duck" lives in Toontown, and has a balance of exactly $3.00 in his account. Or you could go about it the other way: among all the customers with a balance less than $10.00 in their accounts, CustomerID 1243, aka "Daffy Duck", is the only one living in Toontown, TT.

These relationships are the fundamental basis of a relational database system. By making it possible to easily relate records in different tables to one another, an RDBMS makes it possible to analyze date in different ways, while simultaneously keeping it organized in a systematic fashion, with minimal redundancy.

 
 
>>> More Site Administration Articles          >>> More By icarus, (c) Melonfire
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

SITE ADMINISTRATION ARTICLES

- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: