15.04.2018 Views

programming-for-dummies

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

616<br />

The Basics of Databases<br />

A column in a table represents a single field, often called an attribute. A row<br />

in a table represents a single record, often called a tuple.<br />

What makes tables useful is that you can link them together. So whereas one<br />

table may appear to contain names and addresses while a second table might<br />

also contain names and departments, the two tables are actually sharing in<strong>for</strong>mation.<br />

Instead of having to type a name twice in both tables, you need to<br />

type the name only once, and the link between separate tables automatically<br />

keeps that in<strong>for</strong>mation updated and accurate in all other linked tables.<br />

By linking or relating tables together, you can combine data in different<br />

ways. If you have a list of customers stored in one table and a list of sales in<br />

another table, you can relate these two tables to show which customers are<br />

buying which products, or which products are most popular in specific sales<br />

regions. Basically, relating tables together allows you to create virtual databases<br />

by sharing and combining data from separate database tables. By<br />

combining data from separate tables, you can uncover hidden in<strong>for</strong>mation<br />

behind your data, as shown in Figure 1-6.<br />

Name<br />

Table<br />

Employee ID<br />

Name<br />

Table<br />

Department<br />

Bill Adams<br />

Sally Tarkin<br />

Johnny Brown<br />

Doug Hall<br />

Yolanda Lee<br />

Sam Collins<br />

Randy May<br />

Al Neander<br />

Kal Baker<br />

4Y78<br />

8U90<br />

4T33<br />

4A24<br />

9Z49<br />

1Q55<br />

2E03<br />

4M79<br />

2B27<br />

Bill Adams<br />

Sally Tarkin<br />

Johnny Brown<br />

Doug Hall<br />

Yolanda Lee<br />

Sam Collins<br />

Randy May<br />

Al Neander<br />

Kal Baker<br />

Public relations<br />

Human resources<br />

Engineering<br />

Engineering<br />

Human resources<br />

Engineering<br />

Public relations<br />

Public relations<br />

Human resources<br />

Name<br />

Employee ID<br />

Department<br />

Figure 1-6:<br />

Relational<br />

databases<br />

let you<br />

combine<br />

data from<br />

different<br />

tables.<br />

Bill Adams<br />

Sally Tarkin<br />

Johnny Brown<br />

Doug Hall<br />

Yolanda Lee<br />

Sam Collins<br />

Randy May<br />

Al Neander<br />

Kal Baker<br />

4Y78<br />

8U90<br />

4T33<br />

4A24<br />

9Z49<br />

1Q55<br />

2E03<br />

4M79<br />

2B27<br />

Public relations<br />

Human resources<br />

Engineering<br />

Engineering<br />

Human resources<br />

Engineering<br />

Public relations<br />

Public relations<br />

Human resources

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!