UPDATE flashcard
SET deck_id = (SELECT id FROM deck WHERE name = ?2)
WHERE id = ?1;
