How do I insert record only if the record doesn't exist?
You can do this with a unique constraint &amp; insert or ignore.

Create table:

ironforge:tmp phil$ sqlite3
SQLite version 3.19.3 2017-06-27 16:48:08
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite&gt; create table PaymentInformation
   ...&gt; (
   ...&gt; ID int,
   ...&gt; name varchar(100),
   ...&gt; start date,
   ...&gt; end date );
sqlite&gt;


Add a unique constraint on name and start:

sqlite&gt; create unique index PaymentInformation_name_start on PaymentInformation ( name, start ) ;


Add a row:

sqlite&gt; insert or ignore into PaymentInformation values ( 1,'Phil','2017-01-01','2017-02-02' );
sqlite&gt; select * from PaymentInformation;
1|Phil|2017-01-01|2017-02-02
sqlite&gt;


Add another row with the same name &amp; start date, and it gets ignored:

sqlite&gt; insert or ignore into PaymentInformation values ( 2,'Phil','2017-01-01','2017-02-02' );
sqlite&gt; select * from PaymentInformation;
1|Phil|2017-01-01|2017-02-02
sqlite&gt;