Sort:  

You can see an example usage on the second screenshot.
For more details you can read official documentation.
https://www.sqlite.org/draft/lang_UPSERT.html
https://sqlite.org/lang_conflict.html
If you have any more question let me know.