Checking in a rough draft for some sql stuff