There have been many times when I knew that using a JOIN in my SQL query would have been the right way to get the data that I wanted from multiple tables but I never got them to work properly. I figured I better make notes on this now that it actually worked for me.
Here's an example of an SQL querey that I used to get the email addresses for the users in the comprofiler table (Community builder). In this case, there is a one-to-one mapping but when I add a WHERE to it then it will be a subset.
SELECT email FROM `skat_users` INNER JOIN `skat_comprofiler` ON skat_users.id = skat_comprofiler.user_id
Note: if you were using this in a joomla php file you'd use
SELECT email FROM `#__users` INNER JOIN `#__comprofiler` ON #__users.id = #__comprofiler.user_id