Programming and Data Bases

A.Y. 2023/2024
12
Max ECTS
96
Overall hours
SSD
INF/01 ING-INF/05
Language
English
Learning objectives
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.
Expected learning outcomes
Students will be able to
- design and implement programs in the Python language;
- design a database and implement it into a relational database
Single course

This course cannot be attended as a single course. Please check our list of single courses to find the ones available for enrolment.

Course syllabus and organization

Single session

Lesson period
First semester
Course syllabus
Seminar lectures and exercises on the following topics:

PROGRAMMING:

Introduction (4 hours)
- Computer and information sciences
- Computer architectures and operating systems
- Basics of computer programming and algorithm design
- Boolean algebra and evaluation of predicates

Introduction to the Python programming language: structure and syntax (12 hours)
- Built-in data types
- Variables
- Basic operators
- Input handling
- Conditional execution
- Loops and iterations
- Strings and regular expressions
- Data structures (tuples, lists, sets, dictionaries)

Advanced programming in Python (14 hours)
- Functions
- List comprehension / higher-order functions
- Recursion
- Files management
- Data visualization techniques

Introduction to object-oriented programming (5 hours)
- Concepts (abstraction and composition)
- Objects, classes and packages
- Attributes and methods (with constructors, getters, and setters)
- Inheritance
- Exceptions

DATABASES:

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.
Prerequisites for admission
No prerequisites different from those required for admission to the Master Degree program.
Teaching methods
Class lectures, exercises, and occasionally group assignments to be solved during class using the students' laptops.
Teaching Resources
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 http://dbbook.dia.uniroma3.it/ . 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
Assessment methods and Criteria
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.
INF/01 - INFORMATICS
ING-INF/05 - INFORMATION PROCESSING SYSTEMS
Lectures: 96 hours
Professors: Bernasconi Anna, Braga Daniele Maria