SQL updated with inserts