Added table structure creation to SQL output.

Also prepared filtering items.