1. Home
  2. Computing & Technology
  3. PHP / MySQL

Understanding how SQL databases work

By , About.com Guide

3 of 4

Understanding SQL Relational Databases

So what is a 'relational' database, and how does it use these tables? Well, a relational database lets us 'relate' data from one table to another. Let's say for example we were making a database for a car dealership. We could make one table to hold all of the details for each of the cars we were selling. However, the contact information for 'Ford' would be the same for all of the cars they make, so we do not need to type that data more than once.

What we can do is create a second table, called manufacturers. In this table we could list Ford, Volkswagen, Chrysler, etc. Here you could list the address, phone number and other contact information for each of these companies. You could then dynamically call the contact information from our second table for every car in our first table. You would only ever have to type this information once despite it being accessible for every car in the database. This not only saves time but also valuable database space as no piece of data need be repeated.

Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. Learn MySQL
  5. SQL tutorial - MySQL Tutorial - SQL Database

©2009 About.com, a part of The New York Times Company.

All rights reserved.