Q:

Unexpected results after joining another table

I use three tables to get to the final result.  They are called project_board_members, users and project_team. 
This is the query:
SELECT `project_board_members`. `member_id`,
       `users`. `name`,
       `users`. `surname`,
       `users`. `country`,
       `project_team`. `tasks_completed`
FROM `project_board_members`
JOIN `users`
    ON (`users`. `id` = `project_board_members`. `member_id`)
JOIN `project_team`
    ON (`project_team`. `user_id` = `project_board_members`. `member_id`)
WHERE `project_board_members`. `project_id` = '5'

You can ignore last line because it just points to the project I'm using. 
Table project_board_members holds three entries and have structure like:

id,
member_id,
project_id,
created_at;

I need to get member_id from that table.  Then I join to users table to get name, surname and country.  No problems.  All works! :) 
After that, I needed to get tasks_completed for each user.  That is stored in project_team table.  The big unexpected thing is that I got four entries returned and the big what-the-f*ck is that in the project_board_members table are only three entries. 
Why is that so?  Thanks in advice! 

A:

A SQL join creates a result set that contains one row for each combination of the left and right tables that matches the join conditions.   Without seeing the data or a little more information it's hard to say what exactly is wrong from what you expect, but I'm guessing it's one of the following:
1) You have two entries in project_team with the same user_id. 
2) Your entries in project_team store both user_id and project_id and you need to be joining on both of them rather than just user_id.