Update table based on reference values from another table I have two tables structured like so:

Table1 (reference table)
| Name UNIQUE | Value(Double) |

Table2 (data table)
| Name1 | Name2 | Number(Int) |


I want to add 10 to the number in each row of Table2 where the value of Name1 (from Table1) is greater than the value of Name2 (from the Table1). How can this be done in Sqlite3?
You need to use an UPDATE statement to do this. Unfortunately SQLite does not support using a JOIN clause in an UPDATE statement so you will have to emulate the JOIN within the WHERE clause like so:

UPDATE Table2
   SET Number = Number + 10
 WHERE (SELECT Value FROM Table1 WHERE Name = Table2.Name1) &gt;
       (SELECT Value FROM Table1 WHERE Name = Table2.Name2);


Similar questions that might also help you:

How do I make an update while joining tables on sqlite

Update with JOIN in sqlite