Re: understand basics - multiple cars in a database - selection of one - Mailing list pgsql-novice

From David Johnston
Subject Re: understand basics - multiple cars in a database - selection of one
Date
Msg-id 1391554880518-5790595.post@n5.nabble.com
Whole thread Raw
In response to Re: understand basics - multiple cars in a database - selection of one  (avpro avpro <avprowebeden@gmail.com>)
Responses Re: understand basics - multiple cars in a database - selection of one
List pgsql-novice
avpro avpro wrote
> let me write it differently:
> "when the application is lunched, I would like to select one car and then
> every property, option, transaction (applicable to this car) should be
> recorded by the application automatically. "
>
> the property, option, transaction should be recorded by the application
>
> hope this helps. thanks
>
>
> On 4 February 2014 22:25, Richard Broersma <

> richard.broersma@

> >wrote:
>
>> On Tue, Feb 4, 2014 at 1:20 PM, avpro avpro <

> avprowebeden@

> >wrote:
>>
>>
>>> when the application is lunched, I would like to select one car and then
>>> every property, option, transaction applicable to this car should be
>>> recorded by the application automatically.
>>>
>>> basically I'm trying to avoid a menu adding the relevant car every-time
>>> a
>>> property is changed.
>>>
>>
>> Some clarification:  When you select a specific car, what are you
>> expected
>> your application to do?  What does, "this car should be recorded by the
>> application automatically" mean?
>>

entity tables:  cars; properties; options; transactions
relationship tables: cars-properties; cars-options; cars-transactions (this
could just be a foreign-key, probably)

Application:
1) A Drop-Down populated with data in "Cars" and presented to the user
2) User selects a Car
3) Application uses the CarID associated with the selected car to:
3a) Retrieve all cars-properties records having that CarID
3b) Retrieve all cars-options record having that CarID
3c) Retrieve all cars-transactions (or just transactions) having that CarID

Application now has a record of every property/option/transaction associated
with the selected car.

Retrieve basically means issuing "SELECT * FROM
cars-properties|cars-options|cars-transactions WHERE carID = ?"

Now, of course you need some way to actually get data onto those tables.
Fundamentally that means issuing:

"INSERT INTO cars-properties VALUES (carID, propID)"

Though you also need to populate both the cars and properties tables first
so that the relationship table can be assured of having valid data via
foreign key constraints.

If you go and add a property to cars-properties that is not already on
properties you can either abort and ask the user to add it or automatically
add the indicated property first and then add the cars-properties record.

Your request supposes knowledge of many different areas of "application
development" and "application tiers" (e.g., user-interface[UI], middle-ware,
database drivers, PostgreSQL, and database design - to name the most
obvious).  You should not expect much help from volunteers for such a broad
inquiry.  Mailing lists like this one best operate on specific usability
questions.  There are numerous educational materials and institutions
available whose purpose is to teach people how to do this kind of thing -
though I do not personally have any suitable recommendations and you haven't
really described what experience you already possess.

David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/understand-basics-multiple-cars-in-a-database-selection-of-one-tp5790571p5790595.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.


pgsql-novice by date:

Previous
From: John Meyer
Date:
Subject: Re: understand basics - multiple cars in a database - selection of one
Next
From: David Johnston
Date:
Subject: Re: understand basics - multiple cars in a database - selection of one