Check out example codes for "sqlite update where exists". It will help you in understanding the concepts better.

Code Example 1

UPDATE employees
SET hire_date = (SELECT departments.start_date
                 FROM departments
                 WHERE departments.department_id = employees.department_id
                 AND departments.department_name = 'HR')
WHERE EXISTS (SELECT *
              FROM departments
              WHERE departments.department_id = employees.department_id
              AND departments.department_name ='HR');

Learn ReactJs, React Native from akashmittal.com