Programming and data bases

A.A. 2020/2021
Crediti massimi
Ore totali
Obiettivi formativi
The aim is to provide a comprehensive overview of computer science applied to the solution of real problems. The course will introduce fundamental and advanced programming techniques, using the Python language. Also, it will provide the conceptual and technical tools required to understand and design the specification of a database and to implement it into a relational database.
Risultati apprendimento attesi
Students will be able to
- design and implement programs in the Python language;
- design a database and implement it into a relational database
Programma e organizzazione didattica

Edizione unica

Primo semestre
Most of the lessons will be held in classrooms of the Politecnico di Milano (consult the detailed courses timetable for further details). However, they will be simultaneously streamed online on the Microsoft Teams platform, and the recordings will be made available to students.
Seminar lectures and exercises on the following topics:


- Introduction to computer and information sciences. Computer architectures and operating systems.
- The basics of computer programming and algorithm design.
- Introduction to the Python programming language. Structure and syntax. Data types.
- Advanced programming in Python. Subroutines, functions and procedures. Introduction to object-oriented programming. Files.
- Elements of scientific programming. Libraries for matrices, tables and statistical functions. Data visualization techniques.


Introduction (2 hours)
· Data versus information. The notions of Information System, Database, and DBMS. Data types, constraints, and data integrity. Queries and applications: transactional and analytical systems. Users, roles, tools and modules of a DBMS.

Relational Theory (6 hours)
· The Relational Data Model: domains, relations, tuples (informal and formal definitions); null values and primary keys.
· Relational Algebra: basic and derived operators. Simple queries.
· Complex queries; query composability and equivalence.

SQL: Structured Query Language (12 hours)
· Definition of domains and tables; primary and foreign key constraints.
· Simple SQL queries (projection, selection, joins, sorting, aggregates).
· Complex queries (set operators, grouping, nesting, views).
· Modifications (of data and schema).
· Advanced schema specification: generic integrity constraints, reaction policies, triggers and procedures (hints).
· Physical data storage, indexing, and query execution cost (hints).

Conceptual and Logical Design (6 hours)
· The Entity-Relationship model: constructs, identifiers, hierarchies and their properties.
· Phases and abstractions in database design (life cycle, strategies, quality measures).
· Logical design: translation principles, hierarchy resolution, management of identifiers, attributes, and associations. Normalization and physical design (hints).

Other Data Models (4 hours)
· Ordered, nested, hierarchical data models. The case of XML.
· Queries and query languages for non-relational data.
No prerequisites different from those required for admission to the Master Degree program.
Metodi didattici
Class lectures, exercises, and occasionally group assignments to be solved during class using the students' laptops.
Materiale di riferimento
The slides presented during the course and many solved exercises are available on "Be e-Poli" (BeeP), the portal for the network activities of students and professors at Politecnico di Milano.

Recommended textbooks:
Database Systems - Concepts, Languages and Architectures
P. Atzeni, S. Ceri, S. Paraboschi and R. Torlone
McGraw Hill - 1999 - ISBN: 978-0072353877
(Freely available at . Chapters 1-8, that cover most of the course content and present well established notions, are still perfectly valid)

Updated version (only available in Italian):
Basi di Dati (5a Edizione)
P. Atzeni, S. Ceri, P. Fraternali, S. Paraboschi and R. Torlone
McGraw Hill - 2018 - ISBN: 978-8838694455

Z.A. Shaw, Learn Python the hard way: A very simple introduction to the terrifyingly beautiful world of computers and code. (3rd Edition) (Zed Shaw's Hard Way Series) 3rd Edition
Modalità di verifica dell’apprendimento e criteri di valutazione
The assessment is based on a written exam at the end of the course, with exercises and open questions on all the topics presented in the course.
Lectures: 96 ore
Docenti: Braga Daniele Maria, Pinoli Pietro