Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


Database Design


Database Design

Author
Message
victor64
victor64
Forum God
Forum God (5.3K reputation)Forum God (5.3K reputation)Forum God (5.3K reputation)Forum God (5.3K reputation)Forum God (5.3K reputation)Forum God (5.3K reputation)Forum God (5.3K reputation)Forum God (5.3K reputation)Forum God (5.3K reputation)

Group: Forum Members
Posts: 26, Visits: 28
Hello,

I am having difficulties designing a database with data from table 1 referencing multiple data in table 2. For example:

Table 1 includes:

id   Title

1    105MM   

2    155MM


Table 2 includes:

id    Country

1     BEL

2     CAN

3     FRA

4.    ITA

How do I design both Tables in order to link Table 1 with multiple records in Table 2?.

For example when I select 105MM, I want to see all the records from Table 2 that pertains to 105MM. I am trying to avoid duplicating the coutrires in table 2 just to link to the id column in table 1.

Output Example:

105MM
   - BEL
   - CAN
   - ITA

155MM
   - BEL
   - FRA
   - ITA

I think I need to add other columns in Tables 1 and 2 because if I only use the ID columns from both tables, I will only link to table 2 where the ID columns match in both tables. I want to be able to see multiple records in table 2 that applies to a record in table 1. For example when selecting 105MM in table 1, I want to see
BEL, CAN,ITA from tablle. Those same countries may also be linked with other titles in table 1.

Thanks,

Victor

vb5prgrmr
vb5prgrmr
Forum God
Forum God (40K reputation)Forum God (40K reputation)Forum God (40K reputation)Forum God (40K reputation)Forum God (40K reputation)Forum God (40K reputation)Forum God (40K reputation)Forum God (40K reputation)Forum God (40K reputation)

Group: Forum Members
Posts: 167, Visits: 786
tblTitle

iTitleID

vTitle

 

tblCountry

iCountryID

iTitleID

vTitle

 

Granted, prefix of tbl=table, i=number(includes autonumber), v=text, the create relation between tblTitle (table1) iTitleID and tblCountry (table2) iTitleID

 

Good Luck

 

GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search