From: | Martín Marqués <martin(at)bugs(dot)unl(dot)edu(dot)ar> |
---|---|
To: | Marcelo Pereira <gandalf(at)sum(dot)desktop(dot)com(dot)br> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Create Table |
Date: | 2001-11-13 14:04:57 |
Message-ID: | 20011113140459.A901F2AB3F@bugs.unl.edu.ar |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Mar 13 Nov 2001 10:33, you wrote:
> Hi All,
>
> I know it is a really single question, but I am without any
> reference... Does anyone can help me ?
>
> I have to tables (example): 'seller' and 'sells'
>
> seller:
>
> CodSeller | NameSeller
> ----------------------
> 1435 | Mark
> 2486 | Tim
>
> Sells:
>
> CodSell | CodSeller | Description
> ---------------------------------
> 001 | 1435 | xya sfaks
> 002 | 2486 | sdf sdfsd
>
> So, I can create seller like:
>
> create table seller (codseller integer, nameseller char(35));
>
> My question is how to create 'Sells' and link it with 'Seller', can I
> force delete cascades with this relation ?
CREATE TABLE sells (
codsell INT, -- could be serial
codseller INT REFERENCES seller ("CodSeller"),
Description CHAR(60)
);
Saludos... :-)
--
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués | mmarques(at)unl(dot)edu(dot)ar
Programador, Administrador, DBA | Centro de Telematica
Universidad Nacional
del Litoral
-----------------------------------------------------------------
From | Date | Subject | |
---|---|---|---|
Next Message | Jeff Eckermann | 2001-11-13 15:18:30 | Re: Outer Joins |
Previous Message | Mike Mascari | 2001-11-13 14:02:02 | Re: Create Table |