You can do it the easy way and the correct way - most people do it the easy way.
Simply use the primary key from one table as a field in the other table. there is now a simple relationship established, enabling you to carry out joins. However relational integrity is not necessarily enforced, as that depends on the type of table you used when first defining the table.
The commonest default table type is MyISAM, which is fast but doesn't enforce relational integrity. But joins etc will work exactly are advertised, if you make sure the foreign key is entered propery ie no misspelling or typos.
The InnoDB and BDB storage engines provide transaction-safe tables. To maintain data integrity, InnoDB also supports FOREIGN KEY referential-integrity constraints. so here you can't get away with an illegal non-existent foreign key. But its slower.
So the perfect way is to use InnoDB, but you can get away with using MyISAM.
If you use InnoDB, you have to declare the foreign key and the table it relates to.
If you're in one of those predicaments where cls.__private attributes just aren't enough since they can easily be accessed through inst._cls__private, and you need something a little more secure, here's ...