home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / dbteach.zip / DBASE.001 next >
Text File  |  1988-01-26  |  12KB  |  429 lines

  1.  
  2.                dBASE III PLUS HANDOUTS AND QUIZZES
  3.  
  4.                         By Barbara Slyker
  5.  
  6.  
  7.  
  8.                  USING A SAMPLE DATABASE FOR PERSONNEL
  9.  
  10.  
  11.  
  12.  1.  Create a databse called EMPLOYEE with file structure as follows:
  13.  
  14.    Field Name   Type          Width   Dec       (Contents to Put in Field)
  15.    ======================================
  16.  1 SOC_SEC_NO   C             11                Social Security Number
  17.  2 FNAME        C             20                First name
  18.  3 LNAME        C             15                Last name
  19.  4 START_DATE   D                               Date first employed
  20.  5 TITLE        C             20                Job title
  21.  6 SALARY       N              9     2          Bi-monthly salary
  22.  
  23.  
  24.  2.  Using APPEND, add five records to your database called EMPLOYEE as
  25.      follows:
  26.  
  27.  555-55-5555  Jennifer    Jones         090784  Secretary       1000
  28.  666-66-6666  John        Armstead      109386  Clerk-Typist     850
  29.  333-33-3333  Susan       Miller        050781  Instructor      1150
  30.  222-22-2222  Mike        Adams         080783  Instructor      1075
  31.  111-11-1111  Francis     Taylor        100179  Academic Dean   1375
  32.  
  33.  3.  Add two more people to the database using BROWSE.
  34.  
  35.  583-88-2535  Barbara     Brooks        070185  Instructor      1000
  36.  782-33-9829  Robert      Newton        060185  Janitor          850
  37.  
  38.  4.  Using EMPLOYEE change Francis Taylor's last name to Manner.
  39.  
  40.  5.  Mark record 4 for deletion using DELETE.  Recall record 4 so it won't be
  41.      marked for deletion by using RECALL.
  42.  
  43.  6.  Mark record 2 for deletion.  Remove record 2 from the database using PACK.
  44.  
  45.  7.  DISPLAY ALL records then DISPLAY the next 5 records.  DISPLAY the salaries
  46.      of all instructors.  Next DISPLAY STRUCTURE.
  47.  
  48.  8.  Create a report form to display employees and their start dates.  Title
  49.      the file Start_Da and enter an appropriate page title, fields to be
  50.      included, column widths and headings.  Print the report to screen (or
  51.      printer if you have one).
  52.  
  53.  9.  Create a file sorted by social security number entitled emp_ss.  Open
  54.      the database file to verify it is arranged correctly.
  55.  
  56. 10.  Reopen the database Employee and create an index file called emp_last.
  57.      Have LNAME be the first field sorted and FNAME be the second sorted by
  58.      putting a + in between the field names.  Reopen the database Employee
  59.      and use the index file.  List records to verify it is indexed according
  60.      to last name.
  61.  
  62.  
  63. ===============================================================================
  64.  
  65.  
  66.                  dBASE III PLUS ASSISTANT MENUS
  67.  
  68.  
  69.  
  70. ===================   ===============    ========   ============
  71. SET UP                CREATE             UPDATE     POSITION
  72. ===================   ===============    ========   ============
  73. Database file          Database file      Append     Seek
  74. -------------------    Format            --------   -------------
  75. Format for Screen      View               Edit       Locate
  76. Query                  Query              Display    Continue
  77. -------------------    Report            ---------  -------------
  78. Catalog                Label              Browse     Skip
  79. View                 ================     Replace    Goto Record
  80. -------------------                      ---------  =============
  81. Quit dBASE III                            Delete
  82. ===================                       Recall
  83.                                           Pack
  84.                                           =========
  85.  
  86.  
  87. ==========      ==========    ===============    ================
  88. RETRIEVE         ORGANIZE     MODIFY              TOOLS
  89. ==========      ==========    ===============    ================
  90. List             Index         Database File      Set drive
  91. Display          Sort          Format             Copy file
  92. Report          ----------     View               Directory
  93. Label            Copy          Query              Rename
  94. ----------      ==========     Report             Erase
  95. Sum                            Label              List structure
  96. Average                       ==============     ----------------
  97. Count                          Import
  98. ==========                     Export
  99.                               ===============
  100.  
  101.  
  102.  
  103.  
  104.               GETTING TO dBASE III PLUS DOT PROMPTS
  105.  
  106.         1.   Put System Disk #1 in Drive A and data disk in Drive B:  (or load
  107.              DOS first, if needed)
  108.  
  109.         2.   Turn on computer (or press CTRL ALT and DEL if computer is
  110.              already on) and type DBASE
  111.  
  112.         3.   When prompted to do so put System Disk #2 in Drive B
  113.  
  114.         4.   Press {ENTER} then {ESC}  dot prompt appears
  115.  
  116.         5.   Type:  .SET DEFAULT TO B:
  117.              .USE <DATABASE FILENAME>
  118.              .SET FORMAT TO <FORMAT FILENAME>
  119.              .BROWSE
  120.  
  121.         6.   To return to Assistant Menus type ASSIST at the dot prompt
  122.  
  123.  
  124.  
  125.  
  126. ===============================================================================
  127.  
  128. Set Up  Create  Update  Position  Retrieve  Organize  Modify  Tools 08:41:24 pm
  129.  
  130. ===============================================================================
  131.                                    List
  132.                                    Display      ==========================
  133.                                    Report       Execute the command
  134.                                    Label        Specify scope
  135.                                   ----------    Construct a field list
  136.                                    Sum          Build a search condition
  137.                                    Average      Build a scope condition
  138.                                    Count        ==========================
  139.                                   ==========
  140.  
  141.  
  142.  
  143.  
  144.                           RETRIEVING INFORMATION
  145.  
  146.  
  147.           1.  Select "Display"
  148.           2.  Select "Specify scope"
  149.           3.  From submenu select "Next" and press {ENTER}
  150.           4.  Type {15} and then {Enter}
  151.           5.  Select "Construct a field list"
  152.           6.  From submenu choose fields you want to display
  153.           7.  Select "Build a search condition"
  154.           8.  From submenu select field you want to search
  155.           9.  From menu of what are called relational operators select desired
  156.               option
  157.          10.  Selecting "Build a scope condition" is for more advanced and
  158.               won't be covered now.
  159.  
  160.  
  161.     .DISPLAY   ALL   LASTNAME,FIRSTNAME,SALARY   FOR SALARY > 10
  162.  
  163.     DISPLAY [<scope>]  [<expression list>]  [FOR <condition>]
  164.     [WHILE <condition>] [OFF] [TO PRINT]
  165.  
  166.     Scope = which records will be evaluated
  167.  
  168.     RECORD <n>                   - one selected record
  169.     NEXT <n>                     -      beginning with current record to end
  170.     ALL
  171.  
  172.     Expression list = in our case a list of field names
  173.  
  174.     For condition = to display specific records meeting a certain requirement
  175.  
  176.  
  177.  
  178. ===============================================================================
  179.  
  180.  
  181.  
  182.  
  183. COMMENT:  POSSIBLE HANDOUT
  184.  
  185.  
  186.                       MAILING LIST DATABASE
  187.  
  188.  
  189. Mailing lists are common applications of database-management systems.  Design
  190. a mailing list for your personal or office use.
  191.  
  192.  
  193. DATABASE FILE NAME:
  194.  
  195. WHEN AND HOW WOULD YOU USE THIS DATABASE?
  196.  
  197.  
  198.  
  199.  
  200. Enter the field definitions as you would when creating a database file.
  201.  
  202.  
  203.  
  204.  1.  What fields should be in your database?  (Include several, not just the
  205.      most obvious ones.)
  206.  2.  Assign a name to each field.
  207.  3.  Decide whether fields are to be numeric, character, or logical, date or
  208.      memo.
  209.  4.  Decide width of each field and number of decimal places, if any.
  210.  
  211.  
  212. ENTER RECORD STRUCTURE AS FOLLOWS:
  213. FIELD   NAME,TYPE,WIDTH,DECIMAL PLACES
  214.  
  215. 001
  216.  
  217. 002
  218.  
  219. 003
  220.  
  221. 004
  222.  
  223. 005
  224.  
  225. 006
  226.  
  227. 007
  228.  
  229. 008
  230.  
  231. 009
  232.  
  233. 010
  234.  
  235. 011
  236.  
  237. 012
  238.  
  239. 013
  240.  
  241. ===============================================================================
  242.  
  243.  
  244. COMMENT:  POSSIBLE QUIZ FOR EVALUATION AND DISCUSSION
  245.  
  246.  
  247.  
  248.                       dBASE III PLUS--QUIZ
  249.  
  250.  
  251. Create a file called Quizdata.  Create five data fields with name, title and
  252. income being three of the fields.  You choose the title of the other fields.
  253.  
  254.  
  255. Add five records.
  256.  
  257. Display them all.
  258.  
  259. Delete and pack record 3.
  260.  
  261. Mark for deletion record 1 but don't delete it.
  262.  
  263. Add two more records to your database.
  264.  
  265. Make any corrections needed.
  266.  
  267. Display and print out your structure and all your records.
  268.  
  269.  
  270. ===============================================================================
  271.  
  272.  
  273. COMMENT:  POSSIBLE QUIZ FOR EVALUATION AND DISCUSSION.
  274.  
  275.  
  276.  
  277.                      dBASE III PLUS--QUIZ 2
  278.  
  279.  
  280. Write the display dot command needed for each of the following situations.
  281. You may use ASSIST and copy the command lines automatically created by ASSIST.
  282.  
  283.  
  284.  1.  You're going to create a report form and forgot some of the field names.
  285.      How can you see the field names?
  286.  
  287.  
  288.  
  289.  2.  You have 1,000 records in your database and are trying to find the record
  290.      for John Smith.
  291.  
  292.  
  293.  
  294.  3.  You don't want to see the record numbers in the left field when you
  295.      display your records.  What command will display each of your records but
  296.      without showing the record number?
  297.  
  298.  
  299.  
  300.  4.  You want to see all employees who started working before 1980 or who earn
  301.      more than $725.
  302.  
  303.  
  304.  
  305.  5.  You forgot the name of your report form.  What is the BEST command to use?
  306.  
  307.  
  308.  
  309.  6.  How do you see the information in your second record?
  310.  
  311.  
  312.  
  313.  7.  How do you see all the records that have been marked for deletion?
  314.  
  315.  
  316.  
  317.  8.  How do you display the database files on your disk?
  318.  
  319.  
  320.  
  321.  9.  How do you display the current record?
  322.  
  323.  
  324. 10.  How do you display only the first name and salary of all employees?
  325.  
  326.  
  327.  
  328. ===============================================================================
  329.  
  330.  
  331. COMMENT:  POSSIBLE EXAM FOR EVALUATION AND DISCUSSION
  332.  
  333.  
  334.  
  335.                      dBASE III EXAM--PART I
  336.  
  337.  
  338.  1.  Identify the significance (the particular importance) of the following
  339.      numbers in dBASE III PLUS.
  340.  
  341.      a:   1 billion
  342.  
  343.  
  344.      b:   128
  345.  
  346.  
  347.      c:     8
  348.  
  349.      d:    10
  350.  
  351.  
  352.  2.  The  commands or key strokes below are all associated  with dBASE III
  353.      PLUS.  Briefly describe the results of using each.
  354.  
  355.  
  356.      a: Create
  357.  
  358.  
  359.      b: Browse
  360.  
  361.  
  362.      c: Display
  363.  
  364.  
  365.  3.  If you decide to use a Zip Code in your data base, should you designate it
  366.      as a character, a number, or as logical, or can it be either of two or any
  367.      of three?  Why?
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  4.  You have just entered DBASE on your computer system.  Your database
  376.      program disk is in Drive A.  The file of your database that you wish to
  377.      enter is "Accounts".  How do you get into the file?
  378.  
  379.  
  380.  
  381.  
  382. ===============================================================================
  383.  
  384.  
  385.                      dBASE III PLUS EXAM--PART II
  386.  
  387. Set up a database called FINALDAT with the following characteristics.
  388.  
  389.      a:  There should be 5 data fields.
  390.      b:  Three of these fields should be name, title, and income.
  391.      c:  Two of the people should be singers.
  392.      d:  The last names of two individuals in your data base must be "Smith".
  393.          Assign incomes in the range of $5000 to $12000.
  394.      e.  Follow the instructions given below and write THE EXACT COMMAND OR
  395.          PROCEDURE DESCRIPTION USED ON YOUR COMPUTER IN THE SPACES PROVIDED
  396.          AFTER EACH QUESTION.
  397.  
  398.  
  399.  1.  Show how to see all the names with the title singer.
  400.  
  401.  
  402.  2.  See all the names of people earning more than $8000.
  403.  
  404.  
  405.  3.  See the total income for all five names in your file.
  406.  
  407.  
  408.  4.  See record 3 only.
  409.  
  410.  
  411.  5.  See those people who are singers OR who earn more than $8000.
  412.  
  413.  
  414.  6.  Create a report form including four of the five fields.  Print out a
  415.      report for all people earning more than $6500.
  416.  
  417.  7.  Make a backup copy of your file and call it3%9al2.
  418.  
  419.  
  420.  8.  Mark a record for deletion.
  421.  
  422.  
  423.  9.  Remove the marked record from the file to erase them forever.
  424.  
  425.  
  426. 10.  Display all the files on your disk.
  427.  
  428.  
  429.