fixed SQL bugs

updated SQL file to fix load issues.