Hi,
The clan table should be created first before the char table. Reason is that the char table is assigning the clan_id as reference from a table that isn't technically created yet.
Edit the main.sql file, just cut and paste this lines for clan and clan_alliance just above of the lines for the 'char' table.
Hope this helps. Let me know.