add SQL file and fixed SQL select