Checking for existence of a primary id in SQLite database table

 
I would appreciate if anyone with experience using SQLite in mql5 can show me how to check for existence of a primary id in a given table. For example is my table has long values as primary ids, does that mean I can use DatabaseColumnLong() to retrieve the value in a given column and store it in a variable a then compare against another variable whose existence im trying to check for? OR is there a built in function that can return the value a true or false (1 or 0) if a given value exists in a column in SQLite database table ? . 
I would love if you showed me some examples too if you are okay with that. I’ve read some documentation in trying to research this and I was confused alittle hence coming here to ask this .