#id column is assumed to be primary key
INSERT INTO destination_table(id,name)
SELECT id, name
FROM source_table s
WHERE NOT EXISTS (
SELECT 1
FROM destination_table d
WHERE d.id = s.id
);
--- If you never want to have duplicates, you should declare this as a table constraint: ---
CREATE TABLE bookmarks(
users_id INTEGER,
lessoninfo_id INTEGER,
UNIQUE(users_id, lessoninfo_id)
);
---(a primary key over both columns would have the same effect)
It is then possible to tell the database that you want to ignore if the insert didn't work---
INSERT OR IGNORE INTO bookmarks(users_id,lessoninfo_id) VALUES(123,456)