Re: Create Table
От | Mike Mascari |
---|---|
Тема | Re: Create Table |
Дата | |
Msg-id | 3BF127DA.B63948BD@mascari.com обсуждение исходный текст |
Ответ на | Create Table (Marcelo Pereira <gandalf@sum.desktop.com.br>) |
Список | pgsql-general |
Marcelo Pereira 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 ? How about: create table seller ( codseller integer unique not null, nameseller varchar(35) not null ); create table sells ( codsell integer unique not null, codseller integer references seller(codseller) on delete cascade, description varchar(35) not null); Hope that helps, Mike Mascari mascarm@mascari.com > > Thanks in Advance, > > See ya, > > Marcelo
В списке pgsql-general по дате отправления: