Skip to content

About

πŸ›οΈ Full-lifecycle Relational Database design for an Employment Agency: Conceptual E-R modeling, formal access cost optimization, and PostgreSQL/PL-pgSQL implementation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›οΈ Job Center Database Management System

An enterprise-grade Relational Database engineering project modeling an Employment Agency, featuring formal E-R design, mathematical I/O access cost optimization, and advanced PostgreSQL / PL-pgSQL stored procedures.

PostgreSQL PL/pgSQL Database Design Academic Context


πŸ“Œ Project Overview

This project provides a comprehensive database management solution for a regional Employment Agency (Centro per l'Impiego) in Perugia. The system coordinates the complex workflows between:

  • Citizens: Tracking demographics, educational degrees, language certifications, and prior employment histories (separating first-time job seekers from the unemployed).
  • Companies: Managing corporate profiles, workforce sizes, and immediate hiring requests (DIA - Dichiarazione Immediata Assunzione).
  • Agency Branches & Personnel: Office hierarchies, employee shifts, and branch director allocations.
  • Services & Training Programs: Availability declarations (DID - Dichiarazione di Immediata DisponibilitΓ ) and accredited external professional training courses.

Developed for the Databases course (BSc in Computer & Electronics Engineering, University of Perugia), the project rigorously follows the classic engineering lifecycle: Conceptual Design βž” Logical Optimization βž” Relational Normalization βž” Physical DBMS Implementation.


πŸ“ Engineering Lifecycle & Methodology

 [ Requirements & Glossary ]
             β”‚
             β–Ό
 1. Conceptual Design (E-R)     ──► 8-level incremental E-R schema + business constraints
             β”‚
             β–Ό
 2. Logical Optimization        ──► Volume tables, operation load tables & redundancy cost study
             β”‚
             β–Ό
 3. Relational Mapping          ──► 3NF translation, foreign key cascades, domain integrity
             β”‚
             β–Ό
 4. Physical Implementation     ──► PostgreSQL DDL, PL/pgSQL procedures, views & analytical queries

⚑ Logical Optimization & Redundancy Cost Analysis

A central highlight of this project is the formal mathematical analysis of I/O access costs evaluating the trade-off between strict normalization and performance-driven redundancy:

  • The Problem: Whether to dynamically calculate each branch's workforce by querying staff records or maintain a redundant counter (N_dipendenti) directly on the UFFICIO table.
  • Workload Evaluation: Based on operational frequencies ($OP_4$ and $OP_{13}$ at 1/year vs. $OP_{16}$ reading office sizes 960 times/year, with a write cost weighted at $2 \times \text{read}$):
    • With Redundancy: $\approx 86,400$ total annual read accesses.
    • Without Redundancy (Dynamic Joins): $\approx 230,400$ total annual read accesses.
  • Result: Keeping the redundant counter yielded a ~62% reduction in database I/O overhead, mathematically justifying denormalization in high-read workloads.

πŸ“ Repository Structure

β”œβ”€β”€ docs/
β”‚   └── Basi_di_Dati.pdf           # Complete academic documentation and technical report
β”œβ”€β”€ sql/
β”‚   β”œβ”€β”€ schema.sql                 # DDL: Tables, PRIMARY KEYs, FOREIGN KEYs, CHECKs, datediff()
β”‚   β”œβ”€β”€ functions.sql              # PL/pgSQL Stored Procedures (aggufficio, aggpersonale, etc.)
β”‚   └── queries.sql                # DML: Insert scripts, Views, and OP1-OP29 operations
└── README.md

πŸš€ Deployment & Local Execution

Prerequisites

Setup via psql CLI

# 1. Clone the repository
git clone https://github.com/BillyErMago/Job_Center_Database_PostgreSQL.git
cd Job_Center_Database_PostgreSQL

# 2. Create the target database
createdb centro_impiego -U postgres

# 3. Execute the schema (DDL & table constraints)
psql -U postgres -d centro_impiego -f sql/01_schema.sql

# 4. Load the procedural functions (PL/pgSQL)
psql -U postgres -d centro_impiego -f sql/02_functions.sql

# 5. Run test operations, views, and analytical queries
psql -U postgres -d centro_impiego -f sql/03_queries.sql

πŸ‘₯ Authors

  • Billal Nadi - BillyErMago
  • Piercarmine De Marco
  • Redon Karakaci

About

πŸ›οΈ Full-lifecycle Relational Database design for an Employment Agency: Conceptual E-R modeling, formal access cost optimization, and PostgreSQL/PL-pgSQL implementation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages