Fixed Sql file

AUTO_INCREMENT must be primary key
Fix more database problems

...