Changes to sql