Updated SQL structure