minor fixes to sql files

might not matter if we can't resolve foreign key problem