First, either use might_have or has_a, not both. Second, if multiple authors may have the same value in the articleId field, might_have will not work. You'd need has_many instead. Finally, Class::DBI doesn't do joins so it will never write SQL like the example you wrote. It will do something like this instead: