update data and create tables