Getting tuples in the database