Fix typo in SQL
Fix SQL string creation for create table statements

In certain situation it was possible that an additional , was created
at the end of the string that lead to a SQL syntax error. This can
be avoided by generating the string by imploding an array of strings.
Therefore we rewrite parts SQL string generation in order to create
a proper SQL statement.
Merge pull request #353 from dsp/dsp/fix-sql-statements

Fix sql statements