Data Base And SQL Emulator Instructions

This emulator demonstrates the simplified, basic activities of storing data into a Data Base table and the subsequent use of a Structured Query Language (SQL).

Like the complete version of a data base system such as MS Access or Oracle DBMS (Data Base Management System), the data to be stored is entered into a table in which the columns are identified by "attribute names". In this emulator, the user can arbitrarily enter attribute names into the first row of the data base. These names are automatically included in the pull down menus of the SQL emulator at the bottom of the page. Each data entity, consisting of a row of data can be entered into the table below.

Once the attribute names and data have been entered into the table, it is possible to manipulate the table through the stylized query at the bottom of the page. In this emulator there are four commands that can be used - SELECT, MODIFY, INSERT, DELETE. When entering a command, always choose the COMMAND first; this will then automatically show the attribute fields that can be modified, and the actions that are to be performed.

The second part of each SQL command is a pair of "where" statements which select the records (rows) in the table which are to be used in the execution of the command.

SELECT: For each record in the data base, if the "where part" of the command is true, then the attribute selected in the "Return Field" is returned. Note that when the SELECT command is chosen, the second row of buttons blank out, indicating that these fields are irrelevent. Fields that can be changed show some text.

MODIFY: For each record in the data base, if the "where part" of the command is true, the value associated with the attribute field "Set Select Field" is SET (see the second command line in the query), i.e. is modified, to the text value entered into the text box to the right. As in other commands, when the MODIFY command is chosen the changeable fields are shown by text values.

INSERT: Similar in action to the MODIFY command, the INSERT permits the replacement of an associated value in the "Set Select Field" with the associated value from the "Return Field". The text box on the right of the second command line is not used.

DELETE: Fields in a record can be deleted (set to blank) through the DELETE command. The particular field to be deleted is identified as the "Return Field" in the first command line.

In all the above commands, if a menu item (attribute) is not selected, no action is taken.

The "where" section of the SQL command is composed of two conditions, comparing the "Select Search Field" and text entered into a text box in each of the last command lines. Between the two conditions, a logical operation can be selected (see the button normally identified by AND). If this button is set to blank, then the second condition is not used.

NOTE: If additional attribute names are to be added to the data base table, or attribute names are to be changed, make sure that you exit the attribute field using a "TAB" and double check that it has been added to the pull down menus.

Last updated 2002/04/16
© J.A.N. Lee, 2002.