notes.id
UPDATE
students
SET
points = points + 1
WHERE
student_id = (
SELECT
student_id
FROM
notes
WHERE
notes.id = 1
)
We can get the same result using explicit joinUPDATE notes
INNER JOIN students ON notes.student_id = students.id
SET students.points = students.points + 1
WHERE notes.id = 1