initial sql work done and tested