DB table design and sql script(script not corret)