|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Urgent Many 2 many relation question
Hi there ppl,
I have a many to many relation problem. I'm writing a program that needs to search documents for keywords and store the info in a db. But a doc can have many keywords and a keyword can have many docs. How can I represent that in a db? Thanx JP |
|
#2
|
||||
|
||||
|
create table documents
( id integer not null primary key , name varchar(99) not null ); create table keywords ( id integer not null primary key , keyword varchar(44) not null ) create table documentkeywords ( docid integer not null , keyid integer not null , primary key ( docid, keyid ) , foreign key ( docid ) references documents ( id ) , foreign key ( keyid ) references keywords ( id ) ); |
|
#3
|
|||
|
|||
|
Thank you
Hi ya
Thank you soooo much :-) It works like a dream!! JP |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Urgent Many 2 many relation question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|