Elements of Computation for IES -Dbase-III

DBASEIII COMMANDS -Notes

Database Organization: SORT, INDEX
SORT Command
·   The SORT command gives us the ability to copy the record and structure of a database to another database.
·   Files can be arranged in either ascending order or descending order by using SORT command.
·   Sort command can be used in multiple fields for data arrangement.
·   SORT command creates a new database file. But the new file contains records of the original database file only the order is different.

INDEX command
·   Index command can also be used to organize a data file. When you index a database, you ask dBASE to create a separate and smaller file based upon designated fields in the database.
·   The index command does not create a new database file. It creates an index file for the database with a default extension (.NDX).
·   Unlike SORT command however INDEX does not permit the user to arrange the data in descending order

DIFFERENCE BETWEEN SORT AND INDEX COMMAND
Sort Command
Index command
· Creates a new database file
Does not create a new file
· Arranges the records in ascending and descending order
Arranges the records only in ascending order
· File extension is .DBF
File extension is .NDX
· Slower than index command
Faster than   sort command
· Renumbers records
Does not renumber records

FIND and SEEK Commands
·   The FIND and SEEK commands both are used in indexed database.
·   FIND operates with character strings, while SEEK operates with either character string or numeric values.
·   The SEEK command like FIND command also works only with an index file. When you SEEK command with strings, you must use quotes.

COUNT Command
·   The COUNT command helps in finding the number of records in the active database that meet a given condition.

LOCATE Command
·   The LOCATE command is used to find the records in a database which satisfy certain conditions.

The Record Pointer
How did the EDIT command display only the 5th record? This can be explained by the concept of a record pointer that is maintained for each file opened by dBASEIII+.

GOTOLISTEDIT

REPLACE

The REPLACEcommand is used to REPLACE the contents of one or more specified field either the current record or all record, depending on the form of the command.

BROWSE Command
BROWSE command gives an option of adding new records. The BROWSE command also provides the option of displaying and modifying selective fields

MODIFY STRUCTURE
The MODIFY STRUCTURE command helps to change the structure of an active database file. The command:

DELETE & PACK
·   The delete command marks the current record for deletion
·   Now delete all the records in the active database file BIODATA. You will find an asterisk (*) against the records marked for deletion.
·   PACK CommandThis command removes records permanently from the database file. Once packed a record cannot be recovered. Deleting records in dBASEIII+ is a two step process. The records are first marked for deletion with the DELETE command, and then removed permanently from the file by PACK command

Let us take the following example
. USE BIODATA
. DELETE 3
. PACK
Next if you give LIST command then you will not find record 3 in database.

RECALL Command
The RECALL command is used to unmark those records that were marked for deletion with DELETE command. Like DELETE command, RECALL has several forms.

SELECT command
To allot work areas for different files in dBASE. dBASE assigns numbers 1 to 10 or characters A to J to these work areas. The general form of the SELECT command is

.SELECT workarea
.USE filename

ALIAS Names for Database Files
dBASE has got a facility to give an alternate or an ALIAS name to a database file dB1

The SET RELATION TO Command
This command is used to link two database files with or without a common field between them

ACTIVE AND NON-ACTIVE FILES
When several files are in use by the SELECT command, the file that is selected last is called the active file and other files are called non-active files

1.       How many databases can be used simultaneously in dBASE III+?  10 DATABASES
2.       Give the name of the first work area used in dBASE III+. A
3.       Which command is used to select a work area in dBASE III+?   SELECT
4.       Differentiate between active and non-active files.
5.       Choose the correct answer:
(a) What is the maximum number of work areas that can be used in dBASE
       (i) 20               (ii) 10              (iii) 5       (iv) 9
(b) The first work area in dBASE is referred as
       (i) W -area   (ii) ‘A’             (iii)  ‘A-J’  (iv) none of the above

Answers
1.  10 databases
2.  The first work area in database is A.
3.  SELECT command
4.  The file that is selected last is called the active file and other files are called non-active files.
5.   (a)  ii  (b)  ii

Questions

1.  Which command is used for report creation?
2.  What are the sub-menus of COLUMNS menu?
3.    Choose the correct answer
    (a) The extension name for Report file is
       (i)  .NDX    (ii) .DBF  (iii) .FRM (iv) .PRG
    (b)  How many items dBASE displays in the main menu of Report generation?
       (i) 2    (ii)  7(iii) 5  (iv)  none of the above

Answers
1.  CREATE or MODIFY commands are used in report creation.
2.  Contents, Heading, Width, Decimal places, Total This Column are five sub menus of COLUMNS menu.
3.  (a) iii      (b) iii

WAIT COMMAND

The WAIT command suspends processing of a program and waits for the user to press any key. It accepts only a single keystroke and does not require the ENTER key to be pressed. 

Comments

Popular posts from this blog

Beauty of Mechanical Engineering

ICC Cricket World Cup 2023

FEELING BIRTHDAY