SQL for Minesweeper