SQL: combine replace/update SQL query methods
Changes: updated