wrote SQL for updating record tables.