Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Relational Guru Help Needed!
Message
From
18/01/1999 17:15:42
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Relational Guru Help Needed!
Miscellaneous
Thread ID:
00177376
Message ID:
00177376
Views:
85
I need some help in correctly setting up my tables. I've never had these kinds of requirements before so here it goes.

Let's say I need to setup a system to store different characteristics of an automobile. Let assume I want to store info. on all possible combinations of TYPE (car, van, truck), COLOR (blue, black, etc.), TRANSMISSION (auto, 5-speed, etc.) and DOORS (4-door, 2-door, etc.).

The way I originally though is to create 3 tables as follows:
TABLE: CLASS
CLASSID   N-1O Primary key
CLASS     C-10

This table will hold one record for each type of characteristic (TYPE, COLOR, TRANSMITTION, DOORS.

TABLE: CODES
CODEID   N-10 Primary key
CLASSID  N-10 Foreigh key
CODE     C-3  (Code assigned to characteristic - e.g. A)
DESCR    C-20 (Description of code - e.g. VAN)

This table will hold one record for each "CLASS" and characteristic.

TABLE: COMBINED
COMBID     N-10 PK
COMBCODE   C-10   (Combined code of each different classes)
DESCRIPT   MEMO   (Combined description of different classes)
COST       N-10-2 (Cost of each particular kind of car)

This table will hold one record for combination of each "class" and characteric.  

Example: COMBCODE  DESCRIPT                     PRICE
         A1A1      Car, Blue, Auto, 4-door      $10,000
         A1A2      Car, Blue, Auto, 2-door      $9,500
         A1B1      Car, Blue, 5-speed, 4-door   $9,750
         A1B2      Car, Blue, 5-speed, 2-door   $9,250
Now, I need to "update" the COMBINED table data everytime a user changes (add,delete,edit) codes in the CODES table. How can I set this up so that I can easily do this? Relationally speaking, is my table setup adequate to handle this (I don't think so)?
It's "my" world. You're just living in it.
Next
Reply
Map
View

Click here to load this message in the networking platform