modified sql structure