This repository contains the SQL schema and queries for a comprehensive hospital database management system, focused on tracking patients, medical staff, interventions, and clinical records.
The database system manages various aspects of a hospital's operations, including:
- Patient information and medical records
- Medical staff (doctors, surgeons, residents)
- Surgical interventions and hospitalizations
- Diagnostic tests and examinations
- Pathologies and treatments
Pasotti_Conti_DDL.sql
: Database definition language script that creates the tables and relationshipsPasotti_Conti_DMLPOP.sql
: Data manipulation language script that populates the tables with sample dataPasotti_Conti_DMLUPD.sql
: Examples of data manipulation operations like registering new patients and retrieving clinical recordsPasotti_Conti_SQL.sql
: Collection of sample queries demonstrating various SQL operations and analyses
The database consists of the following main tables:
Medici
: Base table for all medical staffChirurghi
: Surgeons with their specializationsSpecializzandi
: Residents with their qualifications
Paziente
: Patient personal informationRicovero
: Hospitalization recordsCartellaClinica
: Patient clinical recordsIntervento
: Surgical interventionsPatologie
: Pathologies and their statusContiene
: Links pathologies to clinical records
Visita
: Patient examination dataEcografia
: Ultrasound examination resultsFarmaci
: Prescribed medications
DRG
: Diagnosis-related group classificationsPrendonoParte
: Tracks medical staff participation in interventions
INSERT INTO PAZIENTE VALUES('178','Falegname','Massimo','Troisi','Single');
SELECT paziente.id_paziente, professione, nome, cognome, stato_familiare,
medico_int, medico_vis, medico_pt, problemi_respiratori, allergie, intolleranze
FROM Paziente JOIN CartellaClinica ON Paziente.id_Paziente = CartellaClinica.ID_Paziente
WHERE paziente.id_paziente = '123';
- The database uses cascading updates for referential integrity
- Comprehensive foreign key relationships ensure data consistency
- Character varying types allow for flexible text storage
- Date fields track temporal aspects of patient care and interventions
- SQL-compatible database management system
- Sufficient privileges to create tables and manipulate data
- Matteo Pasotti
- Simone Conti