Slide 9

CSCI 201 Guest Lecture: Data Modeling


Example: A bad data model

Good Problem

Peter's Pump Company (PPC) manufactures and sells electric powered water pumps for farm irrigation. PPC has six pump models, distinguished by their capacity in gallons per minute (GPM). Each pump also has a model number, an associated drawing (identified by drawing number), a price, and a quantity on hand (QOH). Whenever the QOH for a particular pump model goes below 10, Peter sends a work order to the manufacturing shop to build 20 more of that model. Peter wants a computer program to keep track of the relevant data and to automate the generation of work orders.

Bad Solution

Quick and Dirty Harry (QDH) comes up with a solution to the data modeling problem. He formulates PPC's data as a table:

GPM Model Drawing Price QOH
25 LX25 131467 $47 28
50 MX55 133519 $76 18
100 MX105 135221 $132 6
200 MX205 137733 $212 11
500 SX505 157393 $248 15
1000 XX1000 175418 $459 21

QDH thinks this is a really cool solution. It can be mapped directly to a 2D array (or could be mapped to a list of C structs). Data can be written to and read from disk easily, and in the array in memory, performance will be excellent for queries and updates. To add a new pump model, just increase the array's row dimension. To add a pump attribute, just increase the array's column dimension.

Next page


Email: Richard dot J dot Wagner at gmail dot com

dm05.htm, this hand crafted HTML file created October 18, 1997.
Last updated October 22, 2010, by Rick Wagner. Copyright © 2010, all rights reserved.