I'm in the process of developing/designing a small system to keep track of servers, what applications run on these servers, and for each application what environments exists on the server. I have a quick question about good design patterns/practices.

I have 3 tables, one for each entity. They are (abbreviated) as follows:

```
Server
Id : int

Application
Id : int

Environment
Id : int

```

Now, my question is:

Would it be acceptable to create a joining table as such:

```
AppServerEnvironments
ServerId : int
ApplicationId : int
EnvironmentId : int

```

Or, is it better practice to create two joining tables as such:

```
ApplicationServer
ServerId : int
ApplicationId : int

ApplicationEnvironment
ApplicationId : int
EnvironmentId : int

```

I've tried going with the second option, but cannot seem to figure out a way to join all 3 tables properly.

Any input/guidance is greatly appreciated.

Thank you!