how to create table from database