Relational databases remain fundamental to modern data storage systems. The standard design process follows a three-stage pipeline: E/R diagram creation, relational schema translation and final SQL code generation. The latter two stages are non-trivial, time-consuming and highly prone to error, especially when dealing with complex E/R diagrams. Automating this process is critical, yet existing tools offer incomplete solutions. Current tools fall into two categories: proprietary, production-ready systems that are often inaccessible, and free, open-source alternatives that are usually lacking. These open-source options frequently provide only partial translations, lack support for advanced structures such as hierarchies or fail to implement robust integrity constraints necessary for guaranteeing data consistency. This thesis bridges that gap by proposing and implementing a comprehensive, opensource Python tool that fully automates the conversion of E/R models (e.g. those created using ERDPlus) into executable SQL code. The tool ensures complete data consistency by automatically generating all necessary constraints and triggers. The central innovation is the tool's configurable handling of E/R hierarchies, allowing for user-selected upward and downward collapsing translation methodologies. Furthermore, the tool provides flexibility in choosing translation methods for composite attributes and relationships, delivering completeness and automation in a single, accessible package.
I database relazionali rimangono fondamentali per i moderni sistemi di archiviazione dei dati. Il processo di progettazione standard segue una pipeline in tre fasi: creazione del diagramma E/R (Entità/Relazione), traduzione dello schema relazionale e generazione finale del codice SQL. Le ultime due fasi non sono banali, richiedono tempo e sono altamente soggette a errori, soprattutto quando si tratta di diagrammi E/R complessi. Automatizzare questo processo è cruciale, eppure gli strumenti esistenti offrono soluzioni incomplete. Gli strumenti attuali si dividono in due categorie: sistemi proprietari e completi che sono spesso inaccessibili, e alternative gratuite, open-source che solitamente sono carenti. Queste opzioni open-source spesso forniscono solo traduzioni parziali, non supportano strutture avanzate come le gerarchie o non implementano vincoli di integrità robusti necessari a garantire la coerenza dei dati. Questa tesi colma tale lacuna proponendo e implementando uno strumento Python open-source e completo che automatizza interamente la conversione dei diagrammi E/R (ad esempio, quelli creati utilizzando ERDPlus) in codice SQL eseguibile. Lo strumento garantisce la completa consistenza dei dati generando automaticamente tutti i vincoli e i trigger necessari. L'innovazione centrale è la gestione configurabile delle gerarchie E/R da parte dello strumento, che consente metodologie di traduzione con collasso verso l'alto e verso il basso selezionabili dall'utente. Inoltre, lo strumento offre flessibilità nella scelta dei metodi di traduzione per gli attributi compositi e le relazioni, fornendo completezza e automazione in un unico pacchetto accessibile.
Translation of e/r diagrams to SQL code with constraints and triggers: collapse of hierarchies
ZHAO, CHENMING
2024/2025
Abstract
Relational databases remain fundamental to modern data storage systems. The standard design process follows a three-stage pipeline: E/R diagram creation, relational schema translation and final SQL code generation. The latter two stages are non-trivial, time-consuming and highly prone to error, especially when dealing with complex E/R diagrams. Automating this process is critical, yet existing tools offer incomplete solutions. Current tools fall into two categories: proprietary, production-ready systems that are often inaccessible, and free, open-source alternatives that are usually lacking. These open-source options frequently provide only partial translations, lack support for advanced structures such as hierarchies or fail to implement robust integrity constraints necessary for guaranteeing data consistency. This thesis bridges that gap by proposing and implementing a comprehensive, opensource Python tool that fully automates the conversion of E/R models (e.g. those created using ERDPlus) into executable SQL code. The tool ensures complete data consistency by automatically generating all necessary constraints and triggers. The central innovation is the tool's configurable handling of E/R hierarchies, allowing for user-selected upward and downward collapsing translation methodologies. Furthermore, the tool provides flexibility in choosing translation methods for composite attributes and relationships, delivering completeness and automation in a single, accessible package.| File | Dimensione | Formato | |
|---|---|---|---|
|
2025_12_Zhao.pdf
accessibile in internet per tutti
Descrizione: Tesi magistrale
Dimensione
2.29 MB
Formato
Adobe PDF
|
2.29 MB | Adobe PDF | Visualizza/Apri |
I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.
https://hdl.handle.net/10589/247576