So, the problem is that I need to find the the total number of gifts received by the people with the nationality 'America', Now I have 2 different tables named gift_info and users_info, the users_info table contains the nationality attribute while the gift_info contains the gift_id attribute.
I have come up with something like
SELECT users_info.user_id, gift_info.gift_id, users_info.nationality
FROM gift_info
LEFT JOIN users_info
ON gift_info.gift_id = users_info.user_id
where users_info.nationality = 'America'
the output this query gives is the user_id, the gift_id and the nationalities 'America' while I need the the total number of gifts recived by people of nationality 'America'.
ON gift_info.gift_id = users_info.user_idcorrect ?