|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Oracle tables design
Hi everyone,
I'm new to oracle and I would like some help designing a table(s). My database contains 6 tables 2 of them are the ones that I want to establish some kind of relatonship between them. Product Table: Prod_ID (PK) Prod_name Varchar2(30) Revinfo table: Rev_ID (PK) Rev_Name varchar2(30) The 3th table is the one that connect the two tables Rev table: Rev_ID (PK) Prod_ID (INT) The problem is that each rev_ID handles one or more Prod_ID and vise-versa,one PROD_ID can have one or more Rev_ID. How can I create this table that handles on to many relationship both ways. Thanks in advance |
|
#2
|
|||
|
|||
|
Rev table:
Rev_ID (PK) Prod_ID (INT) How can I create this table that handles on to many relationship both ways.?? Make the foreign key instead of primary key, as shown below Rev table: Rev_ID (FK) Prod_ID (INT) You can also define the Prod_ID as a foreign key, if required. |
|
#3
|
|||
|
|||
|
Oracle table design
Quote:
Thanks Shafique, I'll try that. |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Oracle tables design |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|