In most cases, when you want to match data from one table in a database to another, a common approach is to use a JOIN clause in your query.
For example, if you had a list of candidates in one table, and a list of donations made to candidates (with one field having a candidate ID in it), you'd probably either use JOIN clause or a WHERE clause to match them together:
(pseudo-code)
SELECT * FROM candidates, donations where candidates.candidate_id = donations.candidate_id;
Sometimes we need to get information from a database where the information is, for whatever reason, not stored in one table but broken into smaller tables with an identical structure. A good example of this is our Social Security Administration Death Master file.