SQL qurey updated for join on problem and author