Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 52948 invoked from network); 30 Nov 2005 13:56:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Nov 2005 13:56:56 -0000 Received: (qmail 37814 invoked by uid 500); 30 Nov 2005 13:56:56 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 37459 invoked by uid 500); 30 Nov 2005 13:56:55 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 37448 invoked by uid 99); 30 Nov 2005 13:56:54 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Nov 2005 05:56:54 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=RCVD_IN_SORBS_WEB,SPF_PASS,UPPERCASE_25_50 X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of legolas.w@gmail.com designates 64.233.162.206 as permitted sender) Received: from [64.233.162.206] (HELO zproxy.gmail.com) (64.233.162.206) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Nov 2005 05:58:24 -0800 Received: by zproxy.gmail.com with SMTP id x3so78604nzd for ; Wed, 30 Nov 2005 05:56:33 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=iLsXHKbmP/o8wFeCmo5pYseuhHoHj3g0c/EcXTQYTxaNWTSGX0rbdtfm7vpNm+W6rm9gtLVgdLzjXe8W+nal4Jwu6+zNf1EKA45ofaVcGOOuZKuJDn0ILM0I9N5GvoKwS+4DsddEtV1a0z834D22thB5LppkRqdpwrrAESwTr+s= Received: by 10.65.156.11 with SMTP id i11mr150321qbo; Wed, 30 Nov 2005 05:56:31 -0800 (PST) Received: from ?62.60.184.87? ( [62.60.184.87]) by mx.gmail.com with ESMTP id e18sm1149308qba.2005.11.30.05.56.28; Wed, 30 Nov 2005 05:56:31 -0800 (PST) Message-ID: <438DAF85.6060204@gmail.com> Date: Wed, 30 Nov 2005 17:26:21 +0330 From: Legolas Woodland User-Agent: Thunderbird 1.5 (Windows/20051025) MIME-Version: 1.0 To: Derby Discussion Subject: Re: How i can create a One-to-Many related tables ? References: <438C76C9.4060906@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Andrus Adamchik wrote: > One-to-many simply means that a table on to-many end has a foreign key > matching primary key of to-one. Here is an example taken from Cayenne > test cases run on Derby. DEPARTMENT - PERSON is one-to-many: > > > CREATE TABLE DEPARTMENT (DEPARTMENT_ID INTEGER NOT NULL, NAME VARCHAR > (100) NOT NULL, PRIMARY KEY (DEPARTMENT_ID)) > > CREATE TABLE PERSON (DEPARTMENT_ID INTEGER, NAME VARCHAR (100) NOT > NULL, PERSON_ID INTEGER NOT NULL, SALARY DOUBLE PRECISION, PRIMARY KEY > (PERSON_ID)) > > ALTER TABLE PERSON ADD FOREIGN KEY (DEPARTMENT_ID) REFERENCES > DEPARTMENT (DEPARTMENT_ID) Thank you for reply . Can i ask which table is client and which table is supplier ? > Cheers, > Andrus Adamchik > > > On Nov 29, 2005, at 6:42 PM, Legolas Woodland wrote: > >> hi >> Thank you for reading my post. >> how i can make a one-to-many related tables ? >> can you pleas give me a sample :) >> >> >> > >