Updated sql commands