Do some SQL stuff