Q: Will looping through SQL results in this way return the desired results? Will this return the output of each row of data since it is within a for loop, or will it reset and keep returning the same first row of data? 
cursor.execute('''SELECT name, first_value, second_value FROM table_name WHERE a < (?) AND b = (?)''', values)
query = cursor.fetchall()
for domain in query:
     domainName, first_value, second_value = query[0][0], query[0][1], query[0][2]


A: IF you want to save data to corresponding variables, do
for domain in query:
    domainName, first_value, second_value = domain

Since domain is a tuple.But data inside these variables will change in each iteration.and set last row as data

A: You're reassigning domainName, first_value and second_value through every domain in your query, so at the end it will only return the LAST domain's data.
