How tomasocchi/lab-bd works
Purpose and Scope
This repository is a SQL coursework/database exercise set targeting both MySQL and PostgreSQL. It defines, populates, queries, updates, and cleans relational databases across two staged deliverables: initial schema/data work (tp1) and subsequent data manipulation plus views (tp2).
Database Platform Boundary
MySQL and PostgreSQL are supported through parallel dialect-specific scripts rather than a shared migration runtime. PostgreSQL additionally separates domain/type setup from schema creation:
• tp1/creacionalMySQL.sql
• tp1/creacionalPostgreSQL.sql
• tp1/dominiosPostgreSQL.sql
Consumers must execute the scripts using their respective database client or deployment mechanism; no application runtime or orchestration layer is present.
TP1: Schema Initialization
The initial structural stage creates the database objects required by the exercises. PostgreSQL setup likely requires domains before table creation, while MySQL uses its own creation script:
• tp1/dominiosPostgreSQL.sql
• tp1/creacionalPostgreSQL.sql
• tp1/creacionalMySQL.sql
This is the primary schema boundary: later scripts assume these database objects already exist.
TP1: Seed Data by Schema/Scenario
Initial data is divided into two population sets, apparently representing separate schemas or exercise datasets. Each DBMS has equivalent seed scripts:
• tp1/pobladoBD1MySQL.sql
• tp1/pobladoBD2MySQL.sql
• tp1/pobladoEsquema1PostgreSQL.sql
• tp1/pobladoEsquema2PostgreSQL.sql
The selected seed path determines the dataset available to downstream exercise queries and mutations.
TP1: Query Exercises and Reset
Standalone exercise scripts execute database queries against the initialized/populated state. MySQL and PostgreSQL receive separate implementations for exercise 6, while exercise 7 is shared:
• tp1/ej6mysql.sql
• tp1/ej6pg.sql
• tp1/ej7.sql
Cleanup scripts return each platform’s database to a cleared state, making them the lifecycle termination/reset boundary:
• tp1/limpiezaMySQL.sql
• tp1/limpiezaPostgreSQL.sql
TP2: Mutations and Derived Views
The second stage operates on an existing schema and dataset. It contains insertion and update scripts in both SQL dialects, followed by database views that expose derived/queryable representations:
• tp2/insercionesMySQL.sql
• tp2/actualizacionesMySQL.sql
• tp2/vistasMySQL.sql
• tp2/insercionesPostgreSQL.sql
• tp2/actualizacionesPostgreSQL.sql
• tp2/vistasPostgreSQL.sql
The intended control flow is schema creation → population → TP2 insertions/updates → view creation/use.
Assertions
tp2/afirmaciones.SQL appears to hold declarative statements or validation assertions over the resulting database state:
• tp2/afirmaciones.SQL
It functions as a verification boundary after data changes and view definitions, though its DBMS compatibility cannot be determined from the file tree alone.
Components 21
MySQL
Dialect-specific SQL lifecycle.
- TP1 schema creation
tp1/creacionalMySQL.sql - Seed dataset 1
tp1/pobladoBD1MySQL.sql - Seed dataset 2
tp1/pobladoBD2MySQL.sql - Exercise 6 queries
tp1/ej6mysql.sql - Database cleanup · Clears the MySQL exercise state.
tp1/limpiezaMySQL.sql - TP2 insertions
tp2/insercionesMySQL.sql - TP2 updates
tp2/actualizacionesMySQL.sql - TP2 views
tp2/vistasMySQL.sql - MySQL exercise database · Created, populated, queried, and reset by MySQL scripts.
PostgreSQL
Dialect-specific SQL lifecycle.
- Domain/type setup · Must precede PostgreSQL schema creation.
tp1/dominiosPostgreSQL.sql - TP1 schema creation
tp1/creacionalPostgreSQL.sql - Seed schema 1
tp1/pobladoEsquema1PostgreSQL.sql - Seed schema 2
tp1/pobladoEsquema2PostgreSQL.sql - Exercise 6 queries
tp1/ej6pg.sql - Database cleanup · Clears the PostgreSQL exercise state.
tp1/limpiezaPostgreSQL.sql - TP2 insertions
tp2/insercionesPostgreSQL.sql - TP2 updates
tp2/actualizacionesPostgreSQL.sql - TP2 views
tp2/vistasPostgreSQL.sql - PostgreSQL exercise database · Created, populated, queried, and reset by PostgreSQL scripts.
Shared exercises
Scripts not split by database platform.
- Exercise 7 queries
tp1/ej7.sql - Result assertions · Validates state after TP2 changes and views.
tp2/afirmaciones.SQL
Connections 29
- TP1 schema creation → MySQL exercise database: creates
- TP1 schema creation → Seed dataset 1: enables
- TP1 schema creation → Seed dataset 2: enables
- Seed dataset 1 → MySQL exercise database: populates
- Seed dataset 2 → MySQL exercise database: populates
- Seed dataset 1 → Exercise 6 queries: query input
- Seed dataset 2 → Exercise 6 queries: query input
- Seed dataset 1 → TP2 insertions: TP2 starting state
- Seed dataset 2 → TP2 insertions: TP2 starting state
- TP2 insertions → TP2 updates: then
- TP2 updates → TP2 views: then
- TP2 views → Result assertions: verify
- MySQL exercise database → Database cleanup: reset
- Domain/type setup → TP1 schema creation: defines prerequisites
- TP1 schema creation → PostgreSQL exercise database: creates
- TP1 schema creation → Seed schema 1: enables
- TP1 schema creation → Seed schema 2: enables
- Seed schema 1 → PostgreSQL exercise database: populates
- Seed schema 2 → PostgreSQL exercise database: populates
- Seed schema 1 → Exercise 6 queries: query input
- Seed schema 2 → Exercise 6 queries: query input
- Seed schema 1 → TP2 insertions: TP2 starting state
- Seed schema 2 → TP2 insertions: TP2 starting state
- TP2 insertions → TP2 updates: then
- TP2 updates → TP2 views: then
- TP2 views → Result assertions: verify
- PostgreSQL exercise database → Database cleanup: reset
- MySQL exercise database → Exercise 7 queries: runs against
- PostgreSQL exercise database → Exercise 7 queries: runs against