Re: Tables

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: Bob Pawley <rjpawley(at)shaw(dot)ca>, Postgre General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Tables
Date: 2005-10-20 18:15:07
Message-ID: BF7D56EB.11252%sdavis2@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/20/05 12:37 PM, "Bob Pawley" <rjpawley(at)shaw(dot)ca> wrote:

> I am new to databases.
>
> I have table 1, a primary source, which generates a serial number to make each
> item unique.
>
> I want to use this number to generate a row in table 2 linking the two rows
> and allowing specific information on each item to be developed..
>
> I have a number of books, including one specifically for Postgres.
>
> What I don't have is the language to look this function up.
>
> Concepts like JOIN appear to used to create views not new rows on other
> tables.

This was confusing to me at first, also. There is no generic function to
create rows in two tables simultaneously. One simply creates the row in the
first table and then creates rows in the second table in a second step. The
"link" between the two tables is a single column that contains the same id.
See any of MANY online tutorials on SQL for an introduction or get a book on
SQL. I found that I had to sit and type verbatim from multiple sources
before I really understood what was going on, so you may want to try that.

Google for SQL tutorial for starters.

Sean

In response to

  • Tables at 2005-10-20 16:37:07 from Bob Pawley

Browse pgsql-general by date

  From Date Subject
Next Message Dann Corbit 2005-10-20 18:19:34 Re: [HACKERS] 'a' == 'a '
Previous Message David Fetter 2005-10-20 17:59:45 Re: doc typo sql-reindex.html psql vs. postgres