start and create function to run sql