Exercise Database 1-1: Text Database
What you will do:
|Find fields and records in a text database.|
Turn word wrapping on and off.
Sort records manually.
from resource files
You will appreciate advanced databases more if you have tried to work
with a basic plain text database. So awkward, even for a small database.
- Open text file: Right click on the link
starwars.txt and choose
. Save the file to the
Desktop of your hard disk.
Warning: If you choose Open instead, the file will appear in this
browser window! You will need to use the Back button to return to this
If the download dialog appears, choose Open. The file will open in
Notepad or in whatever text editor your computer has associated with text files.
dialog does not appear: You were not downloading the file from the
Internet but from your CD or download copy of these pages.
Solution: Minimize this window and any others so that you can
see the Desktop. Right click the icon for
starwars.txt and choose Open With.... From the menu, choose
opened in the browser: You clicked the link or your right clicked
the link and chose
or from the popup menu. You can view the file, but you cannot
Solution: Use the Back button to return to this page and try
- View records: Scroll horizontally to view all of the fields in the records.
The fields do not line up neatly because some records have more text in
certain fields than other records do.
- Word wrap: Toggle word wrapping on and off to see the
difference. (In Notepad for WinXP, Format | Word Wrap. In Notepad for
earlier version of Windows, Edit | Word Wrap.)
Does that help or does it make it harder to read a record?
- Queries: Answer the following questions about this small database:
- How many items were made in 1999?
- in 1977?
- How many items from Episode 4?
- How many items of Queen Amadala?
Problem: Cannot find all of the
items: Print the database with word wrapping turned on (File |
Print). Circle or highlight the items you are looking for. Manual
methods can work well for small databases.
- Sort: Rearrange the order of the records so that the
Episode numbers are in ascending order. (Requires careful selection and
copy and paste). What a pain!
- Edit: Change the text in one or more fields of your choice.
Add your name and the date below the last record.
Print: From the menu choose, File | Print.
(Notepad will wrap the text on the printed page, even if you have Word Wrap turned off.)
- Clean up: Close Notepad without saving your changes and minimize any other windows that
are open. Click on the file you saved to the Desktop and press the
Delete key to delete it.
Perhaps this is enough to demonstrate how hard it is to work directly
with text databases.