I have an application written in .net core which uses Entity Framework. Entity Framework is generating sql similar to the following (simplified for readibility):