Updated SQL test script