Databases (2011/2012)

Course code
Alberto Belussi
Academic sector
Language of instruction
Teaching is organised as follows:
Activity Credits Period Academic staff Timetable
Teoria 9 II semestre, I semestre Alberto Belussi
Laboratorio 3 II semestre Alberto Belussi

Lesson timetable

Learning outcomes

Theory I
The first part of the course, called “Databases Theory”, has the aim to provide the student with the necessary concepts and methods for the design of a database and its applications. In particular, it will be focused on the methodologies for the conceptual and logical design of a database and for the successive database implementation on database systems. Moreover, some general techniques for the implementation of database systems will be presented and the fundamental characteristics of the query language SQL and of the relational algebra will be illustrated.

Theory II
The second part of the course, called “Web and multimedia Applications”, has the aim to provide the student with the necessary concepts and methods for the design of data-intensive web applications. In particular, this module will be focused on a methodology for the logical design of a web application that interacts with a database system (DBMS).
Moreover, the approach Model-View-Controller (MVC-2 servlet centric) will be illustrated and applied to some examples. Finally, the main issues concerning the treatment of multimedia datasets in a DBMS will be presented.

The “Lab” ("Laboratorio" in italian) of the course “Databases and WEB” has the aim to provide the student with the necessary concepts and methods for the implementation of a database and its applications. In particular, this module will be focused on the usage of a specific DBMS for the creation, management and manipulation of a database by means of SQL commands. Moreover, some general techniques for the implementation of web applications will be presented. In particular a MVC-2 architecture based on the Servlet and the Java Server Pages (JSP) technologies will be illustrated and used to show the implementation of some practical examples.


Theory I
* Introduction to database managemente systems (DBMS): architectures and functionalities of a DBMS. Phisical and logical data independence. Data models. Concepts of model, schema and instance of a database. Languages for database systems. DBMS vs. file system.
* Conceptual database design: conceptual data models. The Entity-Relationship model (ER). Elements of the ER model: entities, attributes, relationships, ISA hierarchies and cardinality constraints.
* Logical database design: logical data models, the relational data model. Elements of the relational data models: relations and integrity constraints. Mapping between conceptual schemas in ER model and logical schema in the relational model. Languages for data definition: SQL as DDL. Table creation and integrity constraints definition in SQL.
* Interacting with a database system: languages for the definition, querying and update of a database. The relational algebra. SQL: select-from-where statement, join in SQL, the GROUP BY and ORDER BY clauses, using subqueries. SQL for update: INSERT, DELETE and UPDATE statements. Views.
* The internal architecture of a DBMS. Transactions. Transactions properties. The concurrency control: schedules, view and conflict equivalence, the two-phase locking. Access methods (indexes): primary and secondary indexes, B-+tree, hashing based access methods.

Theory II
The module is organized in 16 hours of lessons and exercises carried out during the second semester. The module will focuses on the logical design of a data-intensive web application and its implementation using: Postgresql, Servlet and Java Server Pages (JSP) technologies. Moreover, the issues concerning the treatment of multimedia datasets in a DBMS will be presented.
In particolar, the following arguments will be illustrated:
* Web Server: basic internet, basic HTML (form), basic HTTP.
* Information systems on the Web: techniques for the interaction between a DBMS and a HTTP server (CGI, Servlet, JSP); JDBC library and Java data beans; the architecture proposed by the MVC-2 approach.
* a methodology for the logical design of a data-intesive web application.
* features of multimedia data: compression techniques and indexing

1. Introduction to DBMS PostgreSQL: connection to a database, table creation, insert, update and alter table.
2. PostgreSQL: integrity constraints, reactions to contraints violations.
3. PostgreSQL: simple SQL queries.
4. PostgreSQL: complex SQL queries.
5. HTML: structure of an HTML document, main tags, tables.
6. HTML: form.
7. Servlet Engine on an application server. Examples of simple servlets.
8. Servlet and JDBC. Connection to a DBMS PostgreSQL. Simple servlet of the interaction with a DBMS.
9. Java bean e servlet.
10. Java Server Pages (JSP)
11. JSP and servlet: a software architecture base on the Model View Controller approach.
12. Servlet/JSP and multimedia datasets.

Assessment methods and criteria

Written tests.

Reference books
Activity Author Title Publisher Year ISBN Note
Teoria P. Atzeni, S. Ceri, P. Fraternali, S. Paraboschi, R. Torlone Basi di dati: architetture e linee di evoluzione (Edizione 2) McGraw-Hill 2007 978-88-386-6370-3
Teoria P. ATZENI, S. CERI, S. PARABOSCHI, R. TORLONE Basi di dati- Modelli e linguaggi di interrogazione (Edizione 3) McGraw-Hill 2009 9788838666001
Teoria E. Baralis, A. Belussi, G. Psaila Basi di dati - Temi d'esame svolti (Edizione 1) Progetto Leonardo Società Editrice Esculapio Bologna 1999 B135655713
Teaching aids
Title Format (Language, Size, Publication date)
1 - Transazioni  pdfpdf (it, 217 KB, 12/03/12)
2 - Gestione della concorrenza  pdfpdf (it, 629 KB, 12/03/12)
3 - Gestione della concorrenza nei DBMS  pdfpdf (it, 588 KB, 19/03/12)
4 - Strutture fisiche e strutture di accesso ai dati (indici)  pdfpdf (it, 558 KB, 20/03/12)
5 - B+-tree e hashing  pdfpdf (it, 1805 KB, 26/03/12)
Algebra relazionale: ottimizzazione  pdfpdf (it, 293 KB, 12/12/11)
Applicazioni Web: dispensa sulla metodologia di progettazione  pdfpdf (it, 283 KB, 16/04/12)
Applicazioni Web: esempio servlet & JDBC  pdfpdf (it, 147 KB, 23/04/12)
Applicazioni Web: introduzione e protocollo HTTP  pdfpdf (it, 352 KB, 02/04/12)
Applicazioni Web: Java Data Beans  pdfpdf (it, 432 KB, 16/04/12)
Applicazioni Web: JSP  pdfpdf (it, 488 KB, 07/05/12)
Applicazioni Web: metodologia di progettazione  pdfpdf (it, 353 KB, 15/04/12)
Applicazioni Web: MVC-2  pdfpdf (it, 443 KB, 07/05/12)
Applicazioni Web: servlet  pdfpdf (it, 261 KB, 03/04/12)
Applicazioni Web: servlet & JDBC  pdfpdf (it, 487 KB, 03/04/12)
Dati multimediali: compressione  pdfpdf (it, 386 KB, 22/05/12)
Dati multimediali: introduzione  pdfpdf (it, 368 KB, 22/05/12)
Dati multimediali: K-d-tree  pdfpdf (it, 363 KB, 28/05/12)
Esercitazione per la prova intermedia  pdfpdf (it, 148 KB, 31/01/12)
Introduzione  pdfpdf (it, 754 KB, 03/10/11)
Progettazione logica  pdfpdf (it, 1092 KB, 22/11/11)
Seconda prova intermedia dell'anno precedente con alcuni esercizi svolti  pdfpdf (it, 230 KB, 29/05/12)
SQL-1  pdfpdf (it, 237 KB, 19/12/11)
SQL-2  pdfpdf (it, 202 KB, 20/12/11)
SQL-3  pdfpdf (it, 216 KB, 10/01/12)
Strategie per la progettazione concettuale  pdfpdf (it, 144 KB, 08/11/11)
Temi d'esame  zipzip (it, 1047 KB, 04/06/12)
XML  pdfpdf (it, 1128 KB, 07/05/12)
XML DTD  pdfpdf (it, 283 KB, 15/05/12)
XML Esercizio  pdfpdf (it, 141 KB, 15/05/12)
XML Esercizio soluzione  pdfpdf (it, 125 KB, 15/05/12)
XML Schema  pdfpdf (it, 974 KB, 07/05/12)
Esercitazione 10: cos.jar  octet-streamoctet-stream (it, 55 KB, 29/05/12)
Esercitazione 10: esercizio  pdfpdf (it, 34 KB, 29/05/12)
Esercitazione 10: lucidi  pdfpdf (it, 483 KB, 29/05/12)
Esercitazione 10: photos_src.tgz  x-gzipx-gzip (it, 4 KB, 29/05/12)
Esercitazione 10: photos_webapp.tgz  x-gzipx-gzip (it, 77 KB, 29/05/12)
Esercitazione 1: esercizio  pdfpdf (it, 45 KB, 03/04/12)
Esercitazione 1: lucidi  pdfpdf (it, 637 KB, 03/04/12)
Esercitazione 2: esercizio  pdfpdf (it, 131 KB, 13/03/12)
Esercitazione 2: lucidi  pdfpdf (it, 982 KB, 13/03/12)
Esercitazione 3: esercizio  pdfpdf (it, 136 KB, 20/03/12)
Esercitazione 3: lucidi  pdfpdf (it, 609 KB, 20/03/12)
Esercitazione 4: esercizio  pdfpdf (it, 69 KB, 27/03/12)
Esercitazione 4: lucidi  pdfpdf (it, 559 KB, 03/04/12)
Esercitazione 5: esercizio  pdfpdf (it, 50 KB, 03/04/12)
Esercitazione 5: lucidi  pdfpdf (it, 2014 KB, 03/04/12)
Esercitazione 6: esercizio  pdfpdf (it, 40 KB, 17/04/12)
Esercitazione 6: lucidi  pdfpdf (it, 1076 KB, 17/04/12)
Esercitazione 6: tomcat  zipzip (it, 34 KB, 17/04/12)
Esercitazione 7: esercizio  pdfpdf (it, 77 KB, 08/05/12)
Esercitazione 7: lucidi  pdfpdf (it, 657 KB, 08/05/12)
Esercitazione 7: servlet con bean  zipzip (it, 4 KB, 08/05/12)
Esercitazione 7: servlet senza bean  zipzip (it, 2 KB, 08/05/12)
Esercitazione 8: esercizio  pdfpdf (it, 64 KB, 15/05/12)
Esercitazione 8: jsp  zipzip (it, 2 KB, 15/05/12)
Esercitazione 8: lucidi  pdfpdf (it, 764 KB, 15/05/12)
Esercitazione 9: daFare.jsp  octet-streamoctet-stream (it, 0 KB, 22/05/12)
Esercitazione 9: ElencoCorsiStudio.jsp  octet-streamoctet-stream (it, 0 KB, 22/05/12)
Esercitazione 9: esercizio  pdfpdf (it, 70 KB, 22/05/12)
Esercitazione 9: lucidi  pdfpdf (it, 364 KB, 22/05/12)
Esercitazione 9: main  octet-streamoctet-stream (it, 2 KB, 22/05/12)