I have a table in MySQL that looks like this:
studentID subjectID anotherID anotherID2, AnotherID3, studentScore
This table has about 100M records of students in it.
Suppose that I have the following information stored in two python lists:
listStudentIDs = [1, 123, 33, 5524, 425653]
listNewScores = [12.76, 73.2, 83.893, 92.3, 53.6]
Is it possible to have one query that will update all studentScore fields for all students (whose IDs are in listStudentIDs) if, and only if, their score in listNewScores is greater than their score currently stored in the database ( studentScore )?
In your example, they are 5 student ids for only 4 scores to update.
If your list of students to update is not to long, then you can have an update in one query like this :
Nevertheless less you may consider to use a SQL statement including several queries :