create table and copy data