# alexander2523/base-de-datos architecture

> Architecture diagram of the GitHub repository alexander2523/base-de-datos, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alexander2523/base-de-datos
- Repository: https://github.com/alexander2523/base-de-datos

## Overview

1. **Repository purpose**
   - This is an educational database-design repository, not an application runtime. Its “architecture” is a curriculum pipeline for moving from requirements to ER modeling, relational modeling, normalization, constraints, and finally SQL implementation in **MySQL** and **SQL Server**.

2. **Overall flow of artifacts**
   - The repository follows a clear progression:
     - **Requirements / analysis**
     - **E-R model**
     - **Relational model**
     - **Data dictionary / normalization / constraints**
     - **SQL DDL (schema creation)**
     - **SQL DML (queries and data manipulation)**
   - That flow is the main architectural boundary to capture in a diagram: conceptual design feeds logical design, which feeds implementation scripts.

3. **Top-level content groups**
   - `01-PruebasSGBD` contains database testing material: a SQL query file and supporting notes/images.
   - `02-Modelado-basededatos` contains conceptual and relational design artifacts.
   - `03-SQL-LDD` contains schema-definition scripts.
   - `04-SQL-LMD` contains query scripts.
   - `ProyectoFinal` is a scaffold for a final project, currently mostly empty placeholders.

4. **Conceptual modeling subsystem**
   - `02-Modelado-basededatos/DiagramasE-R` stores the conceptual ER diagrams as `.dia` files.
   - The diagrams cover multiple example domains: **Biblioteca**, **Compañía**, **Hospital**, **RentaVehículo**, **Odontólogo**, **Proyecto**, and **Universidad/Cursos**.
   - These files represent the source-of-truth for entity/relationship structure before implementation.

5. **Relational modeling subsystem**
   - `02-Modelado-basededatos/Modelo Realcional` contains relational versions of those models, again as `.dia` diagrams.
   - There is also `scrip-restricciones.sql`, which indicates the transition from structure to integrity rules.
   - This is the logical-design boundary: entities and relationships are mapped to tables, keys, and constraints.

6. **Dictionary and datatype documentation**
   - `02-Modelado-basededatos/DicionarioDeDatos` centralizes reference documentation.
   - It includes per-domain dictionaries such as `DiccionarioBiblioteca.md`, `DiccionarioCompañia.md`, `DiccionarioCursos.md`, `DiccionarioHospital.md`, `DiccionarioOdontologo.md`, and `DiccionarioRentasVehiculos.md`.
   - It also includes datatype references for **SQL Server** and **MySQL**, which supports the implementation phase by mapping logical attributes to engine-specific types.

7. **SQL DDL implementation layer**
   - `03-SQL-LDD` is the schema-creation layer.
   - It is split by DBMS:
     - `01-script-mysql`
     - `02-script-sqlserver`
   - The scripts are organized by domain, showing that each model can be implemented separately in each engine.
   - This layer is where tables, keys, relations, and structural constraints are materialized in SQL.

8. **MySQL vs SQL Server boundary**
   - The repository explicitly maintains engine-specific implementations, which is important architecturally.
   - MySQL and SQL Server are not interchangeable here; separate scripts and datatype guidance reflect differences in syntax, constraint handling, and supported features.
   - A diagram should show two parallel implementation tracks fed by the same modeling assets.

9. **SQL Server script coverage**
   - Under `03-SQL-LDD/02-script-sqlserver`, there are scripts for:
     - Introduction
     - Curso
     - Hospital
     - RentaVehiculo
     - Biblioteca
     - Compañía
     - Alter/Drop operations
     - Double relationships
     - Additional instruction examples
   - This suggests SQL Server is used not only for creation scripts but also for schema evolution and relationship edge cases.

10. **MySQL script coverage**
   - Under `03-SQL-LDD/01-script-mysql`, there are scripts for:
     - Biblioteca
     - RentaVehiculo
     - Hospital
     - Compañía
     - Universidad
   - The structure mirrors the modeling domains, reinforcing the idea that each case study becomes a standalone database implementation exercise.

11. **SQL LMD / query layer**
   - `04-SQL-LMD` contains query examples for data manipulation and retrieval.
   - There are both generic/simple queries and a SQL Server-specific set with simple and advanced queries.
   - This layer depends on the schemas produced in LDD and represents the consumer side of the database: querying, filtering, joining, and analysis.

12. **Exercise and testing materials**
   - `01-PruebasSGBD/01-query-pruebassbgd.sql` appears to hold test queries used for validating or demonstrating DB behavior.
   - The accompanying markdown and images suggest this folder is used for practice results or lab documentation, not production code.

13. **Project final scaffold**
   - `ProyectoFinal` has directories for **DiccionarioDeDatos**, **ModeloE_R**, and **ModeloRelacional**.
   - These are placeholders for a full end-to-end database design deliverable, indicating the repo is structured to support independent project work using the same methodology.

14. **What an architecture diagram should emphasize**
   - The correct diagram is a **document-and-script pipeline**, not a service diagram.
   - Main nodes: requirements/docs → ER diagrams → relational diagrams → dictionaries/constraints → DBMS-specific DDL → DBMS-specific queries/tests.
   - Main external technologies: **MySQL**, **Microsoft SQL Server**, and **Dia** for diagramming.

Main entry points: [`02-Modelado-basededatos/Modelo Realcional`](https://github.com/alexander2523/base-de-datos/tree/HEAD/02-Modelado-basededatos/Modelo%20Realcional) (Relational model), [`04-SQL-LMD`](https://github.com/alexander2523/base-de-datos/tree/main/04-SQL-LMD) (Query layer), [`02-Modelado-basededatos/DiagramasE-R`](https://github.com/alexander2523/base-de-datos/tree/main/02-Modelado-basededatos/DiagramasE-R) (ER diagrams), [`02-Modelado-basededatos/DicionarioDeDatos`](https://github.com/alexander2523/base-de-datos/tree/main/02-Modelado-basededatos/DicionarioDeDatos) (Data dictionary)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g1["Pruebas"]
  node_n1["Pruebas SGBD<br/>exercise docs"]
end

subgraph group_g2["Modelado"]
  node_n2["ER diagrams<br/>conceptual models"]
  node_n3["Relational model<br/>logical models"]
  node_n4["Data dictionary<br/>reference docs"]
  node_n5["Restrictions script<br/>integrity rules"]
  node_n15{{"Requirements flow<br/>design pipeline<br/>[README.md]"}}
end

subgraph group_g3["DDL"]
  node_n9["MySQL DDL<br/>schema scripts"]
  node_n10["SQL Server DDL<br/>schema scripts"]
end

subgraph group_g4["LMD"]
  node_n11["Query layer<br/>LMD scripts"]
  node_n12["SQL Server queries<br/>query set"]
  node_n13["MySQL queries<br/>query set"]
end

subgraph group_g5["Proyecto final"]
  node_n14["Final scaffold<br/>project template"]
end

subgraph group_g6["Tecnologías"]
  node_n6(("Dia models<br/>diagramming tool"))
  node_n7["MySQL types<br/>datatype guide"]
  node_n8["SQL Server types<br/>datatype guide"]
  node_n16[("MySQL<br/>DBMS target")]
  node_n17[("SQL Server<br/>DBMS target")]
end

node_n15 -->|"feeds"| node_n2
node_n2 -->|"maps to"| node_n3
node_n3 -->|"documents"| node_n4
node_n3 -->|"constrains"| node_n5
node_n2 -->|"authored in"| node_n6
node_n3 -->|"authored in"| node_n6
node_n4 -->|"guides"| node_n7
node_n4 -->|"guides"| node_n8
node_n3 -->|"implements"| node_n9
node_n3 -->|"implements"| node_n10
node_n7 -->|"adapts"| node_n9
node_n8 -->|"adapts"| node_n10
node_n9 -->|"targets"| node_n16
node_n10 -->|"targets"| node_n17
node_n9 -->|"supports"| node_n11
node_n10 -->|"supports"| node_n11
node_n11 -->|"specializes"| node_n12
node_n11 -->|"specializes"| node_n13
node_n1 -.->|"validates"| node_n11
node_n14 -.->|"reuses"| node_n2
node_n14 -.->|"reuses"| node_n3
node_n14 -.->|"reuses"| node_n4

click node_n1 "https://github.com/alexander2523/base-de-datos/blob/main/01-PruebasSGBD/01-query-pruebassbgd.sql"
click node_n2 "https://github.com/alexander2523/base-de-datos/tree/main/02-Modelado-basededatos/DiagramasE-R"
click node_n3 "https://github.com/alexander2523/base-de-datos/tree/main/02-Modelado-basededatos/Modelo Realcional"
click node_n4 "https://github.com/alexander2523/base-de-datos/tree/main/02-Modelado-basededatos/DicionarioDeDatos"
click node_n5 "https://github.com/alexander2523/base-de-datos/blob/main/02-Modelado-basededatos/Modelo Realcional/scrip-restricciones.sql"
click node_n7 "https://github.com/alexander2523/base-de-datos/blob/main/02-Modelado-basededatos/DicionarioDeDatos/tipos_datos_sqlserver_mysql.md"
click node_n8 "https://github.com/alexander2523/base-de-datos/blob/main/02-Modelado-basededatos/DicionarioDeDatos/tiposdedatossqlserver.md"
click node_n9 "https://github.com/alexander2523/base-de-datos/tree/main/03-SQL-LDD/01-script-mysql"
click node_n10 "https://github.com/alexander2523/base-de-datos/tree/main/03-SQL-LDD/02-script-sqlserver"
click node_n11 "https://github.com/alexander2523/base-de-datos/tree/main/04-SQL-LMD"
click node_n12 "https://github.com/alexander2523/base-de-datos/tree/main/04-SQL-LMD/01-Script-SqlServer"
click node_n13 "https://github.com/alexander2523/base-de-datos/tree/main/04-SQL-LMD/02-Script-Mysql"
click node_n14 "https://github.com/alexander2523/base-de-datos/tree/main/ProyectoFinal"
click node_n15 "https://github.com/alexander2523/base-de-datos/blob/main/README.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_n1 toneBlue
class node_n2,node_n3,node_n4,node_n5,node_n15 toneAmber
class node_n9,node_n10 toneMint
class node_n11,node_n12,node_n13 toneRose
class node_n14 toneIndigo
class node_n6,node_n7,node_n8,node_n16,node_n17 toneTeal
```

## Components

### Pruebas

Query practice and validation materials.

- [Pruebas SGBD](https://github.com/alexander2523/base-de-datos/blob/main/01-PruebasSGBD/01-query-pruebassbgd.sql): exercise docs · Practice queries and lab notes for database behavior validation. · `01-PruebasSGBD/01-query-pruebassbgd.sql`

### Modelado

Conceptual and relational design assets.

- [ER diagrams](https://github.com/alexander2523/base-de-datos/tree/main/02-Modelado-basededatos/DiagramasE-R): conceptual models · Source-of-truth conceptual entity-relationship diagrams across several domains. · `02-Modelado-basededatos/DiagramasE-R`
- [Relational model](https://github.com/alexander2523/base-de-datos/tree/HEAD/02-Modelado-basededatos/Modelo%20Realcional): logical models · Relational translations of the conceptual diagrams, with tables, keys, and relationships. · `02-Modelado-basededatos/Modelo Realcional`
- [Data dictionary](https://github.com/alexander2523/base-de-datos/tree/main/02-Modelado-basededatos/DicionarioDeDatos): reference docs · Domain dictionaries and datatype references used to move from logical design to implementation. · `02-Modelado-basededatos/DicionarioDeDatos`
- [Restrictions script](https://github.com/alexander2523/base-de-datos/blob/HEAD/02-Modelado-basededatos/Modelo%20Realcional/scrip-restricciones.sql): integrity rules · SQL constraints and restriction rules that complement the relational design. · `02-Modelado-basededatos/Modelo Realcional/scrip-restricciones.sql`
- [Requirements flow](https://github.com/alexander2523/base-de-datos/blob/main/README.md): design pipeline · The repository-wide progression from analysis and conceptual design to implementation. · `README.md`

### DDL

Schema definition scripts by database engine.

- [MySQL DDL](https://github.com/alexander2523/base-de-datos/tree/main/03-SQL-LDD/01-script-mysql): schema scripts · MySQL schema creation scripts organized by case study domain. · `03-SQL-LDD/01-script-mysql`
- [SQL Server DDL](https://github.com/alexander2523/base-de-datos/tree/main/03-SQL-LDD/02-script-sqlserver): schema scripts · SQL Server schema creation, evolution, and relationship scripts. · `03-SQL-LDD/02-script-sqlserver`

### LMD

Query and data manipulation scripts.

- [Query layer](https://github.com/alexander2523/base-de-datos/tree/main/04-SQL-LMD): LMD scripts · SQL query examples for retrieval, joins, filtering, and analysis. · `04-SQL-LMD`
- [SQL Server queries](https://github.com/alexander2523/base-de-datos/tree/main/04-SQL-LMD/01-Script-SqlServer): query set · SQL Server-specific simple and advanced query examples. · `04-SQL-LMD/01-Script-SqlServer`
- [MySQL queries](https://github.com/alexander2523/base-de-datos/tree/main/04-SQL-LMD/02-Script-Mysql): query set · MySQL query examples and supporting scripts. · `04-SQL-LMD/02-Script-Mysql`

### Proyecto final

Scaffold for an end-to-end database design project.

- [Final scaffold](https://github.com/alexander2523/base-de-datos/tree/main/ProyectoFinal): project template · Placeholder structure for a full database-design deliverable. · `ProyectoFinal`

### Tecnologías

External tools and target database engines.

- **Dia models**: diagramming tool · The .dia files used to author and maintain ER and relational diagrams.
- [MySQL types](https://github.com/alexander2523/base-de-datos/blob/main/02-Modelado-basededatos/DicionarioDeDatos/tipos_datos_sqlserver_mysql.md): datatype guide · MySQL-oriented datatype mapping guidance for implementation scripts. · `02-Modelado-basededatos/DicionarioDeDatos/tipos_datos_sqlserver_mysql.md`
- [SQL Server types](https://github.com/alexander2523/base-de-datos/blob/main/02-Modelado-basededatos/DicionarioDeDatos/tiposdedatossqlserver.md): datatype guide · SQL Server-oriented datatype mapping guidance for implementation scripts. · `02-Modelado-basededatos/DicionarioDeDatos/tiposdedatossqlserver.md`
- **MySQL**: DBMS target · One implementation track for schema and query scripts.
- **SQL Server**: DBMS target · The parallel implementation track with SQL Server-specific scripts and examples.

## Connections

- Requirements flow → ER diagrams: feeds · Requirements and analysis are represented first as ER models.
- ER diagrams → Relational model: maps to · Conceptual entities and relationships are transformed into relational structure.
- Relational model → Data dictionary: documents · Relational attributes are captured in dictionaries and datatype references.
- Relational model → Restrictions script: constrains · Logical design is refined with integrity and restriction rules.
- ER diagrams → Dia models: authored in · The diagrams are stored as Dia files.
- Relational model → Dia models: authored in · Relational diagrams are also maintained in Dia.
- Data dictionary → MySQL types: guides · Datatype references support MySQL implementation.
- Data dictionary → SQL Server types: guides · Datatype references support SQL Server implementation.
- Relational model → MySQL DDL: implements · Relational models are materialized as MySQL DDL scripts.
- Relational model → SQL Server DDL: implements · Relational models are materialized as SQL Server DDL scripts.
- MySQL types → MySQL DDL: adapts · MySQL datatype guidance feeds MySQL schema creation.
- SQL Server types → SQL Server DDL: adapts · SQL Server datatype guidance feeds SQL Server schema creation.
- MySQL DDL → MySQL: targets · These scripts create schemas in MySQL.
- SQL Server DDL → SQL Server: targets · These scripts create schemas in SQL Server.
- MySQL DDL → Query layer: supports · Implemented schemas are queried from the LMD layer.
- SQL Server DDL → Query layer: supports · Implemented schemas are queried from the LMD layer.
- Query layer → SQL Server queries: specializes · One branch of query examples is SQL Server-specific.
- Query layer → MySQL queries: specializes · Another branch supports MySQL-oriented querying.
- Pruebas SGBD → Query layer: validates · Practice queries and lab notes sit alongside the query layer.
- Final scaffold → ER diagrams: reuses · The final-project scaffold mirrors the same modeling workflow.
- Final scaffold → Relational model: reuses · The final-project scaffold includes a relational-design slot.
- Final scaffold → Data dictionary: reuses · The final-project scaffold includes a data-dictionary slot.
