“Insert if not exists” statement in SQLite

I have an SQLite database. I am trying to insert values (users_id, lessoninfo_id) in table bookmarks, only if both do not exist before in a row. INSERT INTO bookmarks(users_id,lessoninfo_id) VALUES( (SELECT _id FROM Users WHERE User=””+$(“#user_lesson’).html()+”‘), (SELECT _id FROM lessoninfo WHERE Lesson=”+lesson_no+” AND cast(starttime AS int)=”+Math.floor(result_set.rows.item(markerCount-1).starttime)+”) WHERE NOT EXISTS ( SELECT users_id,lessoninfo_id from bookmarks WHERE … Read more

Does it matter what extension is used for SQLite database files?

Are there advantages or disadvantages to the file extension used for SQLite databases? It seems that SQLite itself does not require a naming convention, but there might be other reasons that a particular extension would be useful or problematic – for instance, certain tools, programming languages, installers, etc. Or end user considerations. The most common … Read more