I want to insert new record in database if not already present. I know I can do it if I make that column
Before inserting do a select query:
Select id from tablename where name = 'a' limit 1;
Then check, if the result has rows. If it does not have rows execute the insert statement.