sql working

both updates and selects