- Foundations of Computer Science
- Summary
Course Syllabus
Obiettivi
Al termine del corso lo studente sarà in grado di interrogare e di inferire la struttura implicita della base di dati a partire dalle tabelle che la compongono.
Inoltre lo studente saprà scrivere e correggere gli errori di semplici programmi in Python per la gestione e l'analisi di dataset formati da poche tabelle interconnesse, come quelle disponibili a kaggle.com (formati CSV, TSV, JSON). In particolare, le analisi verranno fatte utilizzando il Jupyter Notebook.
Infine, lo studente potrà interrogare database relazionali usando SQL, sia come linguaggio separato, sia come chiamata in un programma Python.
Conoscenza e capacità di comprensione
Questo insegnamento fornisce le conoscenze basilari e capacità di comprensione relativamente a:
- Database.
- SQL
- Programmazione in Python
- Notebook Jupyter
- Gestione di dati tabellari con Pandas
Conoscenza e capacità di comprensione applicate
Alla fine dell'insegnamento gli studenti saranno in grado di:
- Scrivere interrogazioni in SQL
- Scrivere notebook in Python per gestire dataset
- Scrivere notebook in Python per analizzare e pulire dataset
Autonomia di giudizio
Gli studenti saranno in grado di comprendere autonomamente la qualità dei dati da gestire ed effettuare un'analisi esplorativa usano un notebook Jupyter
Abilità comunicative
Gli studenti saranno in grado di descrivere i processi decisionali che li hanno portati a gestire, pulire, analizzare un dataset.
Capacità di apprendere
Gli studenti saranno in grado di apprendere nuovi linguaggi di programmazioni dedicati all'analisi statistica, in particolare R.
Contenuti sintetici
Organizzazione di dati grezzi: file system, file con delimitatori.
Introduzione ai database. Il modello relazionale dei dati e linguaggio SQL. Select ... From … Where.
Introduzione alla programmazione in Python. Programmazione esplorativa. Gestione dati in formato tabellare.
Cenni di test e debugging.
Programma esteso
- Organizzazione di dati grezzi
- file, directory, tipi di file
- principali comandi da terminale
- file con delimitatori.
- Introduzione ai database.
- Il modello relazionale dei dati
- Il linguaggio SQL: Select ... From … Where su una tabella.
- Interrogazioni su più tabelle.
- Introduzione alla programmazione in Python.
- Array, liste, dizionari
- Cicli
- Organizzazione di un programma: funzioni
- Librerie
- Programmazione esplorativa. Gestione dati in formato tabellare.
- Jupyter Notebook
- Pandas
- Cenni di test e debugging.
Prerequisiti
Conoscenza di un linguaggio di programmazione
Modalità didattica
Lezioni e esercizi al computer.
Tutte le lezioni prevedono una prima parte (circa il 20% del tempo) dove vengono spiegati i contenuti in modalità erogativa, seguita da una parte interattiva basata sullo svolgimento di esercizi.
Le lezioni non vengono registrate nè trasmesse in streaming.
Materiale didattico
- Downey Think Python 2e: How To Think Like a Computer Scientist
- Downey Think Stats 2e
- Downey Elements of Data Science. This book is a bit too basic.
- VanderPlas, Python Data Science Handbook
- Elmasri, Navathe, Fundamentals of Database Systems
Periodo di erogazione dell'insegnamento
Primo semestre (prime 6 settimane)
Modalità di verifica del profitto e valutazione
L'esame consiste di tre parti: uno scritto, un progetto da sviluppare in piccoli gruppi (da 1 a 3 persone) e una prova orale. Tutte le parti devono essere sostenute in lingua inglese.
Esame scritto
Prevede quattro domande a risposta aperta, ciascuna consistente in una query SQL. Vengono valutate la completezza e la correttezza delle risposte. Se lo scritto risulta insufficiente, non è possibile presentare il progetto.
Progetto (in Python)
Il progetto integra tutte le competenze acquisite nell'insegnamento. Il testo della prova è unico per tutti gli appelli fino a settembre 2026.
Modalità di consegna: Successivamente al superamento dello scritto, e comunque entro un mese dalla data dello stesso (e almeno 3 giorni prima della prova orale, se sostenuta), il progetto deve essere caricato pubblicamente su GitHub sotto forma di un singolo notebook Jupyter. Il link al repository va comunicato tramite un apposito form online.
Utilizzo di LLM/Generative AI: È ammesso, ma il notebook deve contenere una sezione dedicata che descriva come tali strumenti siano stati utilizzati. Il progetto viene valutato per correttezza, completezza e originalità (specialmente rispetto alle soluzioni standard generate dalle AI).
Se la discussione evidenzierà utilizzi di AI non dichiarati, verrà assegnato un nuovo progetto e la prova scritta sarà annullata.
Prova orale
Deve essere sostenuta entro un mese dallo scritto e consiste in alcune domande sul progetto e su tutti gli argomenti trattati a lezione, volte a verificare la comprensione del programma.
E' possibile scegliere di sostenere la prova orale solo con domande sul progetto (quindi senza domande sugli argomenti trattati a lezione): chi sceglie questa modalità può ottenere al massimo 24/30.
Un esito insufficiente all'orale rende insufficiente l'intera prova d'esame.
Valutazione finale
Il voto di partenza è calcolato sulla media geometrica (arrotondata per difetto) tra il voto dello scritto e quelli delle tre componenti del progetto (ciascuno espresso da 0 a 30). La prova orale modifica questo voto di un massimo di 3 punti, sia in aumento sia in diminuzione.
È obbligatorio iscriversi allo scritto tramite la segreteria online. Non saranno ammesse eccezioni.
Orario di ricevimento
Il ricevimento è online e su appuntamento a https://www.unimib.it/gianluca-della-vedova
Sustainable Development Goals
Aims
At the end of the course, the students will understand how to query a database, and how to infer the implicit structure of a database from its tables.
Moreover, the students will be able to write and debug some simple programs in Python, to manage and analyze datasets consisting of a few interconnected tables, such as those usually available at kaggle.com (CSV, TSV, JSON formats). This part will taught with the Jupyter Notebook.
Finally, the students will be able to query a relational database using SQL, both via a dedicated interface and from a Python program.
Knowledge and understanding
This course provides basic knowledge and understanding on:
- Data bases
- SQL
- Programming in Python
- Jupyter notebooks
- Managing tabular datasets with Pandas
Applied Knowledge and Understanding
At the end of the course the students will be able to:
- Write SQL queries
- Write Python notebooks to manage datasets
- Write Python notebooks to analyze and clean datasets
Independent Judgment
Students will be able to independently assess the quality of data to be processed and perform exploratory data analysis using a Jupyter Notebook.
Communication Skills
Students will be able to describe the decision-making processes that guided their approach to analyzing and cleaning a dataset.
Learning Skills
Students will be able to learn new programming languages dedicated to statistical analysis, with a particular focus on the R language.
Contents
Organizing raw datasets: file system, delimited files.
Introduction to data bases. Relational Data Model and SQL. Select ... From … Where.
Introduction to programming with Python. Explorative programmaing. Managing tabular data.
Introduction to testing and debugging.
Detailed program
- Organizing raw datasets
- files, directories, types of files
- main command-line commands
- delimiter-separated values
- Introduction to data bases.
- The Relational Data Model.
- SQL: Select ... From … Where on a table.
- Querying two or more tables.
- Introduction to programming in Python.
- Arrays, lists, dictionaries
- Loops
- Organization of a programma: functions
- Modules and libraries
- Explorative programming. Managing tabular data.
- The Jupyter Notebook
- Pandas
- Introduction to testing and debugging.
Prerequisites
Basic knowlege of any programming language
Teaching form
Lectures and exercises with a PC.
Lectures consist of two parts: the first part (approx. 20%) where the content will be introduced by the teacher, and a second (approx. 80%) , more interactive, part based on exercises.
Lectures will be neither recorded nor streamed.
Textbook and teaching resource
- Downey Think Python 2e: How To Think Like a Computer Scientist
- Downey Think Stats 2e
- Downey Elements of Data Science. This book is a bit too basic.
- VanderPlas, Python Data Science Handbook
- Elmasri, Navathe, Fundamentals of Database Systems
Semester
First (first 6 weeks only)
Assessment method
The exam consists of three parts: a written exam, a project to be developed in small groups (1 to 3 people), and an optional oral exam. All parts must be taken in English.
Written exam
It consists of four open-ended questions, each requiring an SQL query. Evaluation is based on the completeness and correctness of the answers. If the written exam is insufficient (a fail), the project cannot be presented.
Project (in Python)
The project integrates all the skills acquired throughout the course. The project specification is the same for all exam sessions until September 2026.
Submission guidelines: Following the successful completion of the written exam, and in any case within one month of its date (and at least 3 days before the oral exam, if taken), the project must be publicly uploaded to GitHub as a single Jupyter notebook. The link to the repository must be submitted via a dedicated online form.
Use of LLMs/Generative AI: This is permitted, but the notebook must include a dedicated section describing how these tools were used. The project is evaluated on correctness, completeness, and originality (especially compared to standard AI-generated solutions).
If the discussion reveals undisclosed uses of AI, a new project will be assigned and the written exam will be voided.
Oral exam
It must be taken within one month of the written exam and consists of a few questions on the project and all topics covered in class, aimed at assessing your understanding of the course syllabus.
Students can choose to answer questions only on the project (not on the topics covered in class): in this case the maximum grade is 24/30.
An insufficient grade in the oral exam results in a fail for the entire exam.
Final Grading
The baseline grade is calculated using the geometric mean (rounded down) of the written exam grade and the grades of the three components of the project (each expressed on a scale from 0 to 30). The oral exam modifies this grade by a maximum of 3 points, either upwards or downwards.
Registration for the written exam via the online student registry (segreteria online) is mandatory. No exceptions will be made.
Office hours
Office hourse are online. You can book a meeting at https://www.unimib.it/gianluca-della-vedova