fixed erd, table design, sql script