Addind joins to sql