Added a function to get a random pair from the database.