Queries and ScheduleRecordDao implementation