do you know how to check if a record exist in qt ?..

what i would like to do is .. i listing all the members in a drop box which the names are from across 2 database tables ...

so i would like to check if this record exist in the first table .. else check in table 2.. then proceed to do something..

but i am stuck on how to check if a record exist in qt.. i am using sqlite.