I want to filter records based on on the time interval but I have timestamps. I have a table 'df' with the following column names:
id - int time - timestamp correctness - boolean subject - text
Every student (id) completes tasks on particular subject (subject). The system assigns "True" value in column "correctness" if the assignment is completed correctly and "False" if not. The time (time) when the student completes the task is also saved by the system.
I need to write an sql query that counts all students who completed 20 tasks successfully within an hour during March 2020. I need to count those who completed the tasks during the hour from the actual time they started and actual time the finished.
Thanks in advance!