'How to join multiple SQL tables without matching columns and different number of row

I was hoping someone could help or point me in the right direction, I’m pretty new to SQL queries having mainly focused on FE and have the following issue.

I have 4 tables I need to connect and pull information from each:

Users, Squad, Games-played and Games.

The current possible column matches through FKs are:

Users

id
Squads

id
Player
Users.id FK
Games played 

id
Squads.id FK
Games.id FK
Games

id
name
Games_played.id FK

I need to get Games.name from the Games table to the Squad table, Games_played is my middle point and I’m wonder how I can use it to get that information across.

I can pass Games.id through to Squads from it being the FK for Games_played.

Games.id corespondents with Games.name (the column I want),

Whilst Games and Squads have a different number of rows I wanted to display Games.name, which may repeat themselves on Squads.

Example desired output:

Users.id = 1 | Squads.Players = w | Games_played.Games.id = 1 | Games.name = x

Users.id = 2 | Squads.Players = y | Games_played.Games.id = 2 | Games.name = z

Users.id = 3 | Squads.Players = s | Games_played.Games.id = 1 | Games.name = x 

So Games_played.Games.id = 1 will always show Games.name = x

Users.id passed to Squads via FK.

Player coming from Squads,

Games.id coming from Games but passed as FK to Games_played and able to join to Squads as Games_played.Games.I’d,

Games.name coming from Games and somehow attached to Squads.

Any help would be greatly appreciated. Thank you.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source