sql script for store schedule