update record at main
rewrite query
update SleepPattern data structure for DB and get set function