update query and demo