how to create a table from database