# CHAPTER 3: Sample Database

The following are the tables in the example database and their contents:

    **** Database: repairs ****

    customers
    hours
    jobs
    personnel
    rates

    *** Table: customers ***

    number      integer
    name        char (20,1)
    address     text (30,120,30)
    phone       char (15,1)

`number` | `name` | `address` | `phone`
`1` | `Mr. R. Lucas` |
    1423 Beach Drive
    Bayville, CA 92308
| `(415) 432-1421`
`2` | `Ms. B. Hooper` |
    32 Ridge Rd.
    Bayville, CA 92308
| `(415) 846-9553`
`3` | `Mr. J. Phillips` |
    63 Shore Blvd.,
    Gull Point, CA 9230
| `(416) 753-8549`
`4` | `Mr. B. Wilson` |
    14 Valley View Drive
    Bayville, CA 92308
| `(415) 922-7691`
`5` | `Ms. C. Marshall` |
    12 Berkeley St.
    Gull Point, CA 9230
| `(416) 753-9772`
`6` | `Ms. H. Watson` |
    82 Oak St.
    Bayville, CA 92308
| `(415) 854-4632`
`7` | `Ms. B. Thompson` |
    23 Valley View Drive
    Bayville, CA 92308
| `(415) 453-7356`
`8` | `Mr. J. Lee` |
    3260 Church St.
    Gull Point, CA 92309
| `(416) 753-8881`
`9` | `Mr. R. Lee` |
    42 St. John Ave.
    Gull Point, CA 92309
| `(416) 753-0884`
`10` | `Mr. G. Wong` |
    640 Madison St.
    Gull Point, CA 92309
| `(416) 752-7833`

    *** Table: hours ***

    number          integer
    job-num         integer
    date            date (5)
    code            shortinteger
    description     char (30,1)
    hours           shortinteger

    number  job-num  date           code    description             hours

     5      350      28 Feb 92       6      Oil change              2
     5      352       1 Mar 92      18      Adjust carburetor       2
     5      352       1 Mar 92       8      Wheel alignment         3
    10      352       1 Mar 92       8      Replace rear wheel      2
    10      352       2 Mar 92       1      Bent left door          6
    10      352       2 Mar 92       3      Replace headlights      2
    10      352       3 Mar 92      11      Major body work         8
    10      352       3 Mar 92       2      Replace windshield      2
    17      396       1 Mar 92       6      Lube & grease           1
    17      401       2 Mar 92       9      Change tires            2
    17      401       2 Mar 92       7      Sparks & tune           1
    17      401       2 Mar 92       8      Wheel alignment         3
    17      401       2 Mar 92       9      Tire repair             2
     5      410       3 Mar 92      17      Synch pistons           2
     5      410       3 Mar 92       7      Tune up                 3

    ***Table: jobs ***

    job-num          integer
    customer no.     integer
    date             date (6)

    job-num   customer no.   date

    350       4              Feb 28 92
    352       6              Mar 1 92
    410       3              Mar 3 92
    401       8              Mar 2 92
    396      10              Mar 1 92

    *** Table: personnel ***

    number           integer
    name             char (25,1)
    phone            char (15,1)
    credit_limit     dollar (6,1)

    Indices:         UNIQUE numberindex ON (number)

    number   name         phone               credit_limit

     3       Jones        (415) 667-2951      $500.00
     4       Scarlatti    (416) 961-7363      $100.00
     5       Mosca        (415) 426-9681      $750.00
     8       Peterson     (415) 978-6060      $250.00
     9       Jordan       (415) 964-3335      $250.00
    10       Kilroy       (415) 426-9681      $500.00
    17       Wladislaw    (415) 811-5110       $10.00

    *** Table: rates ***

    code         shortinteger
    job_type     char (20,1)
    rate         dollar (3, 1)

    code    job_type             rate

    1       Doors                $25.00
    2       Windshields          $20.00
    3       Lights               $15.00
    4       Fenders              $20.00
    5       Axles                $20.00
    6       Lubrication          $15.00
    7       Ignition/Sparks      $20.00
    8       Wheels               $20.00
    9       Tires                $15.00
    10      Transmission         $25.00
    11      Body work            $25.00
    12      Brakes               $20.00
    13      Universal            $25.00
    14      Exhaust              $20.00
    15      Battery              $15.00
    16      Shocks               $15.00
    17      Pistons              $15.00
    18      Carburetor           $20.00
    19      Radiator             $20.00
    20      Distributor          $20.00