Relationships with multiple tables

Bro

New member
Local time
Today, 01:51
Joined
Aug 17, 2005
Messages
6
Hi

I need three tables with a relationship between their primary id columns.

The first two tables:
Code:
CREATE TABLE [Table2] ([id] INTEGER PRIMARY KEY);
CREATE TABLE [Table3] ([id] INTEGER PRIMARY KEY);

and then I need the last SQL query to create Table1 with column id related to the column id in table2 and table3.
As I understand the relationship must to set when creating the table...
so this is what I got:
Code:
CREATE TABLE [Table1] (ID INTEGER PRIMARY KEY CONSTRAINT Table1ID REFERENCES [Table2](ID) REFERENCES [Table3](ID));

This produces no errors but when checking in MS Access there are no relationships between them.

Any help with this is very appreciated!
 
If I read this correctly Table 1 will have 1:1 relationship with Table 2 and Table 3.

Are you sure that a) you want the two 1:1 relationships.

Although it appears that Access does not show the relationships have you actually tested them with data

Noticed that DDL for Table 1 is slightly different. Not sure that it will actually create teh relationships

Checking with some documentation to see if I can find more info

L
 
Hi, thanks for helping me out.

It should look like this:
 

Attachments

  • relationship.png
    relationship.png
    2.8 KB · Views: 139

Users who are viewing this thread

Back
Top Bottom