Database schema construction and validation