Transform ER diagrams to relations