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 :)