I don't know, but I would guess the certificate is looking at the gradebook, not directly at the quiz.
So, grade_items, and grade_grades.
If an activity was not really a Moodle quiz, pushing the grades into the Quiz DB tables seems dangerous. Editing the quiz is likely to cause Moodle to try to re-compute the grades from the individual question scores, which won't exist, so that will go badly.
Instead, it might have been better to import the data from the old system into custom columns in the gradebook.