SELECT c.url AS c_reference, m.url AS parent_ref FROM category c JOIN category_url u ON c.id = u.cat_id LEFT JOIN master_cat m ON m.id = c.cat_id WHERE u.url = 'bags-purses-and-wallets'