Design

From: "R(dot)Stevens" <raimee(at)ij(dot)net>
To: Postgres-General <pgsql-general(at)postgresql(dot)org>
Subject: Design
Date: 1998-08-06 22:04:28
Message-ID: 35CA286B.C3DE2417@ij.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I really only need to start with a good plan. I have the following
problem:

I get data from two text files. The first file contains BlckBook data
on all vehicles. It contains fields such as vin, make, model, year,
etc...
The second file contains vehicle data specific to actual vehicles sold
on an auction. Some fields in this file are vin, amount the vehicle
auctioned for, Auctioners ID, etc...

BlackBook Auction
------- -----
vin -char(8) vin-char(17)
year -char(1) AuctionId
make
model

etc....
The files are related by the following:
BlackBook.vin + BlackBook.year == Auction.vin(1-8) + Auction.vin(10)
That is, the BlackBook vin field and year field match the Auction vin
field characters 1 through eight plus character ten. Character nine is
skipped.

I need to access the Black Book Data (fields including make, blackbook
value, etc..) for a given vehicle in the Auction File. I am not sure
of the best way to accomplish this.

Eventually I will have approx. 200K records in the Auction file and
about 82K records in the BlackBook file.

I see only one option:

1) Build a third table (or view, Although multiple views will be needed
later to establish levels of authorization).
This third table can be construced by reading records from the Auction
File (table), matching a valid vin number and then selecting required
fields from both
tables and copying them to the New table. My problem here is with the
implementation. Do I use a subquery? Or a function? Not sure how to
build the function !

I need some help here. Any suggestions??

Browse pgsql-general by date

  From Date Subject
Next Message Richard Lynch 1998-08-06 23:45:04 Switch database inside psql?
Previous Message Jeff Hoffmann 1998-08-06 18:00:24 help with creating an opclass for a new data type