Return the ids of failed logins
The code looks good to me as well except if you are looking for the ids of the failed logins you would not want to count the ids (SELECT count(id)) but instead just select the id (SELECT id).