updates to sql updating - getting study tags to work