MAQ Software interview question

SQL queries Code for the largest subarray having maximum sum. logical Puzzle.