home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
dbteach.zip
/
DBASE.001
next >
Wrap
Text File
|
1988-01-26
|
12KB
|
429 lines
dBASE III PLUS HANDOUTS AND QUIZZES
By Barbara Slyker
USING A SAMPLE DATABASE FOR PERSONNEL
1. Create a databse called EMPLOYEE with file structure as follows:
Field Name Type Width Dec (Contents to Put in Field)
======================================
1 SOC_SEC_NO C 11 Social Security Number
2 FNAME C 20 First name
3 LNAME C 15 Last name
4 START_DATE D Date first employed
5 TITLE C 20 Job title
6 SALARY N 9 2 Bi-monthly salary
2. Using APPEND, add five records to your database called EMPLOYEE as
follows:
555-55-5555 Jennifer Jones 090784 Secretary 1000
666-66-6666 John Armstead 109386 Clerk-Typist 850
333-33-3333 Susan Miller 050781 Instructor 1150
222-22-2222 Mike Adams 080783 Instructor 1075
111-11-1111 Francis Taylor 100179 Academic Dean 1375
3. Add two more people to the database using BROWSE.
583-88-2535 Barbara Brooks 070185 Instructor 1000
782-33-9829 Robert Newton 060185 Janitor 850
4. Using EMPLOYEE change Francis Taylor's last name to Manner.
5. Mark record 4 for deletion using DELETE. Recall record 4 so it won't be
marked for deletion by using RECALL.
6. Mark record 2 for deletion. Remove record 2 from the database using PACK.
7. DISPLAY ALL records then DISPLAY the next 5 records. DISPLAY the salaries
of all instructors. Next DISPLAY STRUCTURE.
8. Create a report form to display employees and their start dates. Title
the file Start_Da and enter an appropriate page title, fields to be
included, column widths and headings. Print the report to screen (or
printer if you have one).
9. Create a file sorted by social security number entitled emp_ss. Open
the database file to verify it is arranged correctly.
10. Reopen the database Employee and create an index file called emp_last.
Have LNAME be the first field sorted and FNAME be the second sorted by
putting a + in between the field names. Reopen the database Employee
and use the index file. List records to verify it is indexed according
to last name.
===============================================================================
dBASE III PLUS ASSISTANT MENUS
=================== =============== ======== ============
SET UP CREATE UPDATE POSITION
=================== =============== ======== ============
Database file Database file Append Seek
------------------- Format -------- -------------
Format for Screen View Edit Locate
Query Query Display Continue
------------------- Report --------- -------------
Catalog Label Browse Skip
View ================ Replace Goto Record
------------------- --------- =============
Quit dBASE III Delete
=================== Recall
Pack
=========
========== ========== =============== ================
RETRIEVE ORGANIZE MODIFY TOOLS
========== ========== =============== ================
List Index Database File Set drive
Display Sort Format Copy file
Report ---------- View Directory
Label Copy Query Rename
---------- ========== Report Erase
Sum Label List structure
Average ============== ----------------
Count Import
========== Export
===============
GETTING TO dBASE III PLUS DOT PROMPTS
1. Put System Disk #1 in Drive A and data disk in Drive B: (or load
DOS first, if needed)
2. Turn on computer (or press CTRL ALT and DEL if computer is
already on) and type DBASE
3. When prompted to do so put System Disk #2 in Drive B
4. Press {ENTER} then {ESC} dot prompt appears
5. Type: .SET DEFAULT TO B:
.USE <DATABASE FILENAME>
.SET FORMAT TO <FORMAT FILENAME>
.BROWSE
6. To return to Assistant Menus type ASSIST at the dot prompt
===============================================================================
Set Up Create Update Position Retrieve Organize Modify Tools 08:41:24 pm
===============================================================================
List
Display ==========================
Report Execute the command
Label Specify scope
---------- Construct a field list
Sum Build a search condition
Average Build a scope condition
Count ==========================
==========
RETRIEVING INFORMATION
1. Select "Display"
2. Select "Specify scope"
3. From submenu select "Next" and press {ENTER}
4. Type {15} and then {Enter}
5. Select "Construct a field list"
6. From submenu choose fields you want to display
7. Select "Build a search condition"
8. From submenu select field you want to search
9. From menu of what are called relational operators select desired
option
10. Selecting "Build a scope condition" is for more advanced and
won't be covered now.
.DISPLAY ALL LASTNAME,FIRSTNAME,SALARY FOR SALARY > 10
DISPLAY [<scope>] [<expression list>] [FOR <condition>]
[WHILE <condition>] [OFF] [TO PRINT]
Scope = which records will be evaluated
RECORD <n> - one selected record
NEXT <n> - beginning with current record to end
ALL
Expression list = in our case a list of field names
For condition = to display specific records meeting a certain requirement
===============================================================================
COMMENT: POSSIBLE HANDOUT
MAILING LIST DATABASE
Mailing lists are common applications of database-management systems. Design
a mailing list for your personal or office use.
DATABASE FILE NAME:
WHEN AND HOW WOULD YOU USE THIS DATABASE?
Enter the field definitions as you would when creating a database file.
1. What fields should be in your database? (Include several, not just the
most obvious ones.)
2. Assign a name to each field.
3. Decide whether fields are to be numeric, character, or logical, date or
memo.
4. Decide width of each field and number of decimal places, if any.
ENTER RECORD STRUCTURE AS FOLLOWS:
FIELD NAME,TYPE,WIDTH,DECIMAL PLACES
001
002
003
004
005
006
007
008
009
010
011
012
013
===============================================================================
COMMENT: POSSIBLE QUIZ FOR EVALUATION AND DISCUSSION
dBASE III PLUS--QUIZ
Create a file called Quizdata. Create five data fields with name, title and
income being three of the fields. You choose the title of the other fields.
Add five records.
Display them all.
Delete and pack record 3.
Mark for deletion record 1 but don't delete it.
Add two more records to your database.
Make any corrections needed.
Display and print out your structure and all your records.
===============================================================================
COMMENT: POSSIBLE QUIZ FOR EVALUATION AND DISCUSSION.
dBASE III PLUS--QUIZ 2
Write the display dot command needed for each of the following situations.
You may use ASSIST and copy the command lines automatically created by ASSIST.
1. You're going to create a report form and forgot some of the field names.
How can you see the field names?
2. You have 1,000 records in your database and are trying to find the record
for John Smith.
3. You don't want to see the record numbers in the left field when you
display your records. What command will display each of your records but
without showing the record number?
4. You want to see all employees who started working before 1980 or who earn
more than $725.
5. You forgot the name of your report form. What is the BEST command to use?
6. How do you see the information in your second record?
7. How do you see all the records that have been marked for deletion?
8. How do you display the database files on your disk?
9. How do you display the current record?
10. How do you display only the first name and salary of all employees?
===============================================================================
COMMENT: POSSIBLE EXAM FOR EVALUATION AND DISCUSSION
dBASE III EXAM--PART I
1. Identify the significance (the particular importance) of the following
numbers in dBASE III PLUS.
a: 1 billion
b: 128
c: 8
d: 10
2. The commands or key strokes below are all associated with dBASE III
PLUS. Briefly describe the results of using each.
a: Create
b: Browse
c: Display
3. If you decide to use a Zip Code in your data base, should you designate it
as a character, a number, or as logical, or can it be either of two or any
of three? Why?
4. You have just entered DBASE on your computer system. Your database
program disk is in Drive A. The file of your database that you wish to
enter is "Accounts". How do you get into the file?
===============================================================================
dBASE III PLUS EXAM--PART II
Set up a database called FINALDAT with the following characteristics.
a: There should be 5 data fields.
b: Three of these fields should be name, title, and income.
c: Two of the people should be singers.
d: The last names of two individuals in your data base must be "Smith".
Assign incomes in the range of $5000 to $12000.
e. Follow the instructions given below and write THE EXACT COMMAND OR
PROCEDURE DESCRIPTION USED ON YOUR COMPUTER IN THE SPACES PROVIDED
AFTER EACH QUESTION.
1. Show how to see all the names with the title singer.
2. See all the names of people earning more than $8000.
3. See the total income for all five names in your file.
4. See record 3 only.
5. See those people who are singers OR who earn more than $8000.
6. Create a report form including four of the five fields. Print out a
report for all people earning more than $6500.
7. Make a backup copy of your file and call it3%9al2.
8. Mark a record for deletion.
9. Remove the marked record from the file to erase them forever.
10. Display all the files on your disk.