Saturday, November 20, 2010

Data Validation

Definition:Data validation guarantees to your application that every data value is correct and accurate. You can design data validation into your application with several differing approaches: user interface code, application code, or database constraints.
Example: Simple field and lookup validation is sometimes not enough. Consider a health care claim which has a billed amount of $123.57, but the allowable amount may depend on a year-to-date rolling accumulation that is capped at $1500 (not to exceed the lifetime policy maximum of $100,000). In this situation, data validation extends beyond the immediate data entry screen to one of careful evaluation of how to pay this claim based on the policy limits and both year-to-date and lifetime accruals. This kind of complex multifile data validation is often best handled with procedure-based business rules.     
http://msdn.microsoft.com/en-us/library/aa291820(VS.71).aspx
Picture:spreadsheet-data-validation.png
http://blogoscoped.com/files/spreadsheet-data-validation.png

Specialized Databases

Definition: Specialized databases are indexes that can be searched, much like the search engines.
  http://www.webliminal.com/search/search-web07.html
Example:http://www.britannica.com/
Picture:fits_facility_site.gif


http://www.databasezone.com/images/fits_facility_site.gif

database management system

Definition:  A program that sorts, links, and otherwise organizes and manages data in a database. DBMS may also assist in the analysis of data and the preparation of reports.
 http://www.amersol.edu.pe/hs/technology/itgs/GlossaryofTerms.asp#D
Example: Some of the more popular relational database management systems include:
  • Microsoft Access
  • Filemaker
  • Microsoft SQL Server
  • MySQL
  • Oracle
  • http://www.quackit.com/database/tutorial/database_management_systems.cfm
Picture:relational_databases_1.gif
http://www.quackit.com/pix/database/tutorial/relational_databases_1.gif

Flat-file database, relational database, normalization

Flat-file database
   Definition:A flat file database is a database that stores data in a plain text file. Each line of the text file holds one record, with fields separated by delimiters, such as commas or tabs. While it uses a simple structure, a flat file database cannot contain multiple tables like a relational database can. Fortunately, most database programs such as Microsoft Access and FileMaker Pro can import flat file databases and use them in a larger relational database.
   http://www.techterms.com/definition/flatfile
   Example + Picture: aa905447.Flat_DB(en-us,MSDN.10).gif
       http://i.msdn.microsoft.com/aa905447.Flat_DB(en-us,MSDN.10).gif


Relational Database:
   Definition:A relational database is a collection of data items organized as a set of formally-described tables from which data can be accessed or reassembled in many different ways without having to reorganize the database tables. The relational database was invented by E. F. Codd at IBM in 1970.
    http://searchsqlserver.techtarget.com/definition/relational-database
   Example + Picture: 
    http://library2.usask.ca/access98/ppoint/cervone/html/sld008.htm


Normalization:
   Definition: In relational database design, the process of organizing data to minimize redundancy. Normalization usually involves dividing a database into two or more tables and defining relationships between the tables. The objective is to isolate data so that additions, deletions, and modifications of a field can be made in just one table and then propagated through the rest of the database via the defined relationships.
 http://www.webopedia.com/TERM/N/normalization.html


  Example and picture: Normalization.gif


http://www.mahipalreddy.com/images/Normalization.gif

Friday, November 19, 2010

Record

Definition:A single entry for an entity in a database and may be composed of more than one data field (item of data or data element).
  http://www.amersol.edu.pe/hs/technology/itgs/GlossaryofTerms.asp#R
Example:The following program sorts the personnel files shown for the last example. They are sorted by last name. The output records are altered before they are output.
Example D-4 SORTREC_OUTPUT Program
   $standard_level system

         program SORTREC_OUTPUT

   C

   C     This program reads the files TEMPEMP and PERMEMP, sorts them by last

   C  name, outputs them by record, alters the output recors, and prints the

   C  record to $STDLIST.

   C

         integer TEMPFILENUM

        2       ,PERMFILENUM

        3       ,STATUS

   C

         common /PARMS/ TEMPFILENUM, PERMFILENUM, STATUS

   C

         call OPEN_FILES

         call DO_SORT

         call CLOSE_FILES

         stop

         end

   C

         subroutine OPEN_FILES

   C

         system intrinsic HPFOPEN

        2                ,QUIT

   C

         integer DESIGNATOR

        2       ,DOMAIN

        3       ,ACCESS

        4       ,PERMANENT

        5       ,TEMPFILENUM

        6       ,PERMFILENUM

        7       ,STATUS

   C

         character TEMPFILE*10

        2         ,PERMFILE*10

   C

         common /PARMS/ TEMPFILENUM, PERMFILENUM, STATUS

   C

         DESIGNATOR  = 2

         DOMAIN      = 3

         ACCESS      = 11


   C

         TEMPFILE = '%TEMPEMP%'

         PERMANENT = 1

         call HPFOPEN (TEMPFILENUM, STATUS, DESIGNATOR,

        2             ,TEMPFILE, DOMAIN, PERMANENT)

         if (STATUS .ne. 0) then

           print *, 'HPFOPEN error on TEMPFILE.  Terminating.'

           call QUIT (1)

         endif

   C

         PERMFILE = '%PERMEMP%'

         call HPFOPEN (PERMFILENUM, STATUS, DESIGNATOR,

        2             ,PERMFILE, DOMAIN, PERMANENT)

         if (STATUS .ne. 0) then

           print *, 'HPFOPEN error on PERMEMP.  Terminating.'

           call QUIT (2)

         endif

   C

         return

         end

   C

         subroutine DO_SORT

   C

         system intrinsic HPSORTINIT

        2                ,HPSORTERRORMESS

        3                ,HPSORTEND

        4                ,HPSORTINPUT

        5                ,HPSORTOUTPUT

        6                ,QUIT

   C

         integer OUTPUT_OPTION

        2       ,NUMKEYS

        3       ,LENGTH

        4       ,INPUTFILES(3)

        5       ,KEYS(4)

        6       ,TEMPFILENUM

        7       ,PERMFILENUM

        8       ,STATUS

   C

         character ALTSEQ*2

        2         ,MESSAGE*80

        3         ,BUFFER*80

   C

         common /PARMS/ TEMPFILENUM, PERMFILENUM, STATUS

   C


         INPUTFILES(1) = TEMPFILENUM

         INPUTFILES(2) = PERMFILENUM

         INPUTFILES(3) = 0

         LENGTH        = 1

   C

         OUTPUT_OPTION = 0

   C

         NUMKEYS       = 1

         KEYS(1)       = 1

         KEYS(2)       = 20

         KEYS(3)       = 0

         KEYS(4)       = 0

   C

         ALTSEQ(1:1)   = CHAR(255)

         ALTSEQ(2:2)   = CHAR(255)

   C

         call HPSORTINIT (STATUS, INPUTFILES,, OUTPUT_OPTION

        2                ,,, NUMKEYS, KEYS, ALTSEQ)

         if (STATUS .ne. 0) then

           MESSAGE = ' '

           call HPSORTERRORMESS (STATUS, MESSAGE, LENGTH)

           print *,MESSAGE

         endif

   C

         do while (LENGTH .gt. 0)

           call HPSORTOUTPUT (STATUS, BUFFER, LENGTH)

         BUFFER(33:39) = 'Empl. #'

         BUFFER(50:59) = 'Hire Date:'

           print *,BUFFER

           if (STATUS .ne. 0) then

             call HPSORTERRORMESS (STATUS, MESSAGE, LENGTH)

             print *,MESSAGE

           endif

         end do

   C

         call HPSORTEND (STATUS)

         if (STATUS .ne. 0) then

           MESSAGE = ' '

           call HPSORTERRORMESS (STATUS, MESSAGE, LENGTH)

           print *,MESSAGE

         endif

   C

         return

         end

   C


         subroutine CLOSE_FILES

   C

         system intrinsic FCLOSE

   C

         integer*2 DISPOSITION

        2         ,SECURITYCODE

   C

         integer TEMPFILENUM

        2       ,PERMFILENUM

        3       ,STATUS

   C

         common /PARMS/ TEMPFILENUM, PERMFILENUM, STATUS

   C

         DISPOSITION  = 0

         SECURITYCODE = 0

   C

         call FCLOSE (TEMPFILENUM, DISPOSITION, SECURITYCODE)

         call FCLOSE (PERMFILENUM, DISPOSITION, SECURITYCODE)

   C

         return

         end
http://docs.hp.com/en/32650-90080/apds04.html
Picture:database-loading.gif
http://www.ucancode.net/database-loading.gif

Thursday, November 11, 2010

Field, data types, key field/primary key, secondary key

Field:
Definition:An {ordered set} of {fields}, usually stored contiguously.  The term is used with similar meaning in several different contexts.  In a file, a "record" probably has some fixed length, in contrast to a "line" which may have any length and is terminated by some {End Of Line} sequence).  A {database} record is also called a "row".  In a {spreadsheet} it is always called a "row".  Some programming languages use the term to mean a type composed of fields of several other types ({C} calls this a "{struct}"). In all these cases, a record represents an entity with certain field values. Fields may be of a fixed width ({bit}s or {characters}) or they may be separated by a {delimiter} character, often {comma} ({CSV}) or {HT} ({TSV}). In a database the list of values of a given field from all records is called a column. (2002-03-22).
http://www.learnthat.com/define/view.asp?id=6799
Example:, a single VSAM file stores both employee and address records. The correct record interpretation is managed by associating the value of a record type field with a record layout. The following COBOL definition shows how a REDEFINES clause specifies an alternate record type for ADDRESS-INFORMATION. If RECORD-TYPE = "A" Classic Data Architect uses the layout for address data.
01  EMPLOYEE-ADDRESS-RECORD.
    05 EMP-ID            PIC X(6).
    05 RECORD-TYPE       PIC X.
       88 RECORD-IS-EMPLOYEE   VALUE 'E'.
       88 RECORD-IS-ADDRESS    VALUE 'A'.
    05 EMPLOYEE-INFORMATION.
       10 LAST-NAME      PIC X(20).
       10 FIRST-NAME     PIC X(20).
       10 DATE-OF-BIRTH  PIC 9(8).
       10 MONTHLY-SALARY PIC S9(5)V99 COMP-3.
       10 FILLER         PIC X(48).
    05 ADDRESS-INFORMATION REDEFINES EMPLOYEE-INFORMATION.
       10 ADDRESS-LINE-1 PIC X(30).
       10 ADDRESS-LINE-2 PIC X(30).
       10 ADDRESS-CITY   PIC X(20).
       10 ADDRESS-STATE  PIC XX.
       10 ADDRESS-ZIP    PIC 9(5).


 Picture:
        http://freepages.genealogy.rootsweb.ancestry.com/~donegalstrongs/ire_db.gif

Data Types:
Definition: The description of the kinds of data stored, passed and used.
http://www.ois.com/Products/glossary-of-terms.html#d

Example and Picture:
Qualitative vs Quantitative DataTopic Index | Algebra Index | Regents Exam Prep Center

Examine the differences between qualitative and quantitative data.
Qualitative DataQuantitative Data
Overview:
  • Deals with descriptions.
  • Data can be observed but not measured.
  • Colors, textures, smells, tastes, appearance, beauty, etc.
  • Qualitative → Quality
Overview:
  • Deals with numbers.
  • Data which can be measured.
  • Length, height, area, volume, weight, speed, time, temperature, humidity, sound levels, cost, members, ages, etc.
  • Quantitative → Quantit
Example 1:
Oil Painting
Qualitative data:
  • blue/green color, gold frame
  • smells old and musty
  • texture shows brush strokes of oil paint
  • peaceful scene of the country
  • masterful brush strokes
Example 1:
Oil Painting
Quantitative data:
  • picture is 10" by 14"
  • with frame 14" by 18"
  • weighs 8.5 pounds
  • surface area of painting is 140 sq. in.
  • cost $300
Example 2:
Latte
Qualitative data:
  • robust aroma
  • frothy appearance
  • strong taste
  • burgundy cup
Example 2:
Latte
Quantitative data:
  • 12 ounces of latte
  • serving temperature 150ยบ F.
  • serving cup 7 inches in height
  • cost $4.95
Example 3:
Freshman Class
Qualitative data:
  • friendly demeanors
  • civic minded
  • environmentalists
  • positive school spirit
Example 3:
Freshman Class
Quantitative data:
  • 672 students
  • 394 girls, 278 boys
  • 68% on honor roll
  • 150 students accelerated in mathematics




Topic Index | Algebra Index | Regents Exam Prep Center

Created by Donna Roberts
Copyright 1998-2010 http://regentsprep.org
Oswego City School District Regents Exam Prep Center


http://www.regentsprep.org/Regents/math/ALGEBRA/AD1/qualquant.htm

Key field:
  Definition:  A field in a segment or record that holds the value of a key to that record.
  http://www.answers.com/topic/key-field
Primary Key:
   Definition:The primary key of a relational table uniquely identifies each record in the table. It can either be a normal attribute that is guaranteed to be unique (such as Social Security Number in a table with no more than one record per person) or it can be generated by the DBMS (such as a globally unique identifier, or GUID, in Microsoft SQL Server). Primary keys may consist of a single attribute or multiple attributes in combination.
    Example:Imagine we have a STUDENTS table that contains a record for each student at a university. The student's unique student ID number would be a good choice for a primary key in the STUDENTS table. The student's first and last name would not be a good choice, as there is always the chance that more than one student might have the same name. 
   http://databases.about.com/cs/administration/g/primarykey.htm
Picture:PrimaryKey.gif
   http://www.fgcu.edu/support/office2007/access/Images/PrimaryKey.gif

Secondary Key:
    Definition:A key that holds the physical location of a record or a portion of a record in a file or database, and provides an alternative means of accessing data. Also known as alternate key.
    http://www.answers.com/topic/secondary-key

Table

Definition:
  • a set of data arranged in rows and columns;
  • In relational databases and flat file databases, a table is a set of data elements (values) that is organized using a model of vertical columns (which are identified by their name) and horizontal rows. A table has a specified number of columns, but can have any number of rows.
  • http://www.google.com.lb/search?hl=en&source=hp&biw=1436&bih=687&q=define%3A+table&rlz=1R2ADFA_enLB395&aq=f&aqi=g10&aql=&oq=&gs_rfai=

  • Example and picture:



    http://www.cisco.com/en/US/i/100001-200000/110001-120000/119001-120000/119668.jpg