Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- dBsee 4.6 - The Library - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

   Defining the data means to organise the information into a structure.

   The first step to take is to identify the files. The file is the
   container for a group of similar information (all clients, all invoices,
   etc.) Therefore, the information is to be split in groups, and for each
   group, the relative file is to be defined.

   Files contain a variable number of records. A record stores the
   information about one element of the group (one customer, one invoice,
   etc.). Each record is made up of several details, that bundled together,
   describe the single element. For example, each customer may be described
   by a code, a name, an address, and a company name. Each detailed
   information is stored in a field.

   Each field has a given type (ex. numerical, character) that indicates the
   type of information the field can contain. For instance, the customer's
   name could be a character type field of length 20.

   The file can be seen as a table in which the rows correspond to the
   records and the columns correspond to the fields. The length of the file,
   i.e. the number of its rows, can vary, while its structure, i.e. the
   number and type of its columns, is fixed.

   Indexes can be defined on each file. An index is used to logically
   order the file's records according to a specific Index key or Search
   key, and to allow a more rapid search of the information.

   Each index is defined by a indexkey, an expression that assumes a
   specific value for each record of the file. Examples of indexkeys are:

     Cus->CusCod          // The customers are ordered
                          // by the code
     
     UPPER( Cus->City )   // the customers are ordered
                          // by the city, whose name is
                          // converted in upper case.

   In addition to ordering the file, the indexkey is used by the system to
   rapidly seek a particular value within the file.

   A special key exists, called primary key, that uniquely identifies
   each record of the file. The primary key does set some bindings:

     . No more than one primary key can be defined per file.

     . No two records can have the same value for the primary key.

   It is not mandatory to define a Primary Key on the file, although is it
   recommended. Setting a primary key will automatically add a series of
   mechanisms to verify and check the data entered.

   Normally, the indexkey expression is made up of one field, usually a code
   that identifies the record. The files will thus have a key on the
   customer's code, on the article's code, etc. Of course, the key can be
   made up of the concantenation of two or more fields. For instance, the
   People's file could have a primary key on the Lastname, Firstname and
   Birthdate fields.

   After having defined all the files of the database, it is possible to
   create a relationship among them, specifying the integrity rules
   that the single files in the database must obey to.

   For example, when relating the Customer's and to Invoices's file, each
   customer may have one or more invoices. Limitations can be put to the
   contents of the file (the age must range from 0 to 100 yrs) or on the
   relationship (no invoice may exist without an associated customer).

   The definition of relations and integrity rules in a database is a
   fundamental topic. A database made up of a set of files is only a
   placeholder of stand-alone information. A database built on relations and
   integrity rules allows to manage a consistent group of data.

   In the following paragraphs, some techniques are describes for
   normalising the database's structure. The main purpose of these
   techniques is to create an optimised database structure, avoiding
   inconsistent or redundant information.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson