Data Analysis with Microsoft Excel: Updated for Office 2007

(Tuis.) #1

68 Excel


6 Click the Save button.
7 Click the Offi ce button and then click Close to close the workbook.

Importing Data from Databases


Excel allows the user to create connections to a variety of data sources.
You’ve already seen how to create a connection to a text fi le; now you’ll
learn how to create a connection to a database fi le.
A database is a program that stores and retrieves large amounts of data
and creates reports describing that data. Excel can retrieve data stored in
most database programs, including Microsoft® Access, Borland dBASE®,
Borland Paradox®, and Microsoft FoxPro®.
Databases store information in tables, organized in rows and columns,
much like a worksheet. Each column of the table, called a fi eld, stores infor-
mation about a specifi c characteristic of a person, place, or thing. Each row,
called a record, displays the collection of characteristics of a particular per-
son, place, or thing. A database can contain several such tables; therefore, you
need some way of relating information in one table to information in another.
You relate tables to one another by using common fi elds, which are the fi elds
that are the same in each table. When you want to retrieve information from
two tables linked by a common fi eld, Excel matches the value of the fi eld in
one table with the same value of the fi eld in the second table. Because the fi eld
values match, a new table is created containing records from both tables.
A large database can have many tables, and each table can have several
fi elds and thousands of records, so you need a way to choose only the infor-
mation that you most want to see. When you want to look only at specifi c in-
formation from a database, you create a database query. A database query is
a question you ask about the data in the database. In response to your query,
the database fi nds the records and fi elds that meet the requirements of your
question and then extracts only that data. When you query a database, you
might want to extract only selected records. In this case, your query would
contain criteria similar to the criteria you used earlier in selecting data from
an Excel workbook.

Using Excel’s Database Query Wizard

You can import data from a database fi le directly, as you did with the wheat
text fi le. You can also write a query to retrieve only portions of data from
selected tables within the database fi le.
Free download pdf