07276 - Computer Science

Academic Year 2022/2023

  • Docente: Stefano Lodi
  • Credits: 10
  • SSD: ING-INF/05
  • Language: Italian
  • Teaching Mode: Traditional lectures
  • Campus: Rimini
  • Corso: First cycle degree programme (L) in Statistics, Finance and Insurance (cod. 5901)

Learning outcomes

At the end of the course the student will know the structure of a computer and the basic elements of programming and relational database querying. In particular, the student will have the ability to: - develop simple programs and queries, with special emphasis on examples of statistical processing; - use the R and SQL languages.

Course contents

  • Coding of information
    • Binary codings
    • Binary numbers
    • Character codes
  • Operating systems
    • Single-user
    • Multi-user
    • Client/server
  • Computer architectures
    • Von Neumann architecture
    • Fetch cycle
  • Networks
    • Local networks
    • Geographic networks
    • Network interconnection
  • Internet
    • Communication protocols
    • Domain Name System
  • The R language
    • Vectors
    • Lists
    • Matrices
    • Data frames
    • Reading and writing files
    • Conditional and looping instructions
    • Function definition
    • Graphics and packages
  • The relational model of data
    • Attributes
    • Relation and database schema
    • Tuple, relation and database
    • Relational algebra
  • Integrity constraints
    • Keys and superkeys
    • Referential integrity
  • The SQL language
    • General Characteristics
    • Expressions and basic predicates
    • Subselect
    • FROM, WHERE, SELECT clause
    • BETWEEN, LIKE, IS NULL predicates
    • Join and subquery
    • IN predicate
    • Quantified predicates
    • GROUP BY, HAVING clause
    • Column functions
    • Correlated subqueries
    • Outer Joins
    • Set operations and full-select
    • Statement CREATE TABLE
    • Integrity constraints: PRIMAY KEY, UNIQUE, FOREIGN KEY
    • Statement INSERT, UPDATE, DELETE
    • Statement GRANT, REVOKE
    • Statement CREATE VIEW
  • Laboratory exercises: application of programming notions in R and SQL to simple cases of data transformation and analysis. The exercises will be carried out on personal computers owned by students, using preinstalled software on remote university computers.

Readings/Bibliography

Course slides and exercises are available on Virtuale.

All books are optional.

Recommended on the R language:

Statistical processing with R in more depth (in English):

The SQL language in more depth:

  • Van der Lans, R. F. (2001). Introduction to SQL.

Teaching methods

NOTE: As concerns the teaching methods of this course unit, all students must attend Module 1, 2 on Health and Safety online.

The course is composed of

  • frontal lessons in a lecture room, employing three fourths of the total number of course hours,
  • lessons in a laboratory, or in a lecture room using personal computers owned by students, employing one fourth of the total number of course hours, each comprising both frontal expositions and exercises on programming techniques and the solution of query and data analysis problems, presented in the expositions.

Assessment methods

The examination is composed of three parts.

Part 1: Examination on programming in R and the design of SQL queries in laboratory

    • The student is given in Esami OnLine (eol.unibo.it): The description of a data base in SQL and the description in Italian of data in table format to be retrieved from the data base using SQL; the description of a set of tables in R and the description in Italian of a computation on the tables to be executed in R
    • The student must write on Esami OnLine: queries written in SQL which retrieve the requested data, and a R program which executes the requested computation
    • Duration: 50m
    • The assessment is obtained as the arithmetic mean of the mark of the R program between 0 and 30, and the mark of the SQL queries between 0 and 30. The marks of the R program and the SQL queries are computed by subtracting from 30, for each error, a penalty which depends on the error
    • Reading books and bound notes is allowed.

Part 2: Multiple choice test

  • The student is given a collection of 15 sentences, each of which has 3 possible completions, of which only one is correct. The test is performed entirely on eol.unibo.it
  • Duration: 1h
  • Reading any type of material is not allowed.

Part 3: Oral examination

  • The student must answer one or two questions which may concern any part of the contents of the course. In particular, the student must show: in-depth knowledge of all the theoretical notions of the discipline which have been presented during the course, of the R and SQL languages, and to be skilled in writing short R programs and SQL queries.

Validity of the parts, exam dates

  • The number of exam dates a student is allowed to take is not limited, not even in the same exam session; however, taking a part of the exam nullifies any previous assessment of that part
  • The assessments of Part 1 and Part 2 are valid until the end of the session (winter, summer, autumn) in which the part has been taken
  • Beyond that deadline, the assessment of every part taken is zero.

Computation of the final mark

  • The computation of the final mark takes place at the end of the oral examination. The oral examination may be taken only if the maximum final mark is at least 18
  • The final mark is the average of the most recent assessments of Part 1 and 2, and Part 3. The parts have equal weight.

Attendance does not contribute to the assessment in any way.

Teaching tools

  • Presentation of the course topics using a overhead projector
  • WiFi access using own PC to a virtual lab with R and Microsoft SQL Server during lessons
  • Teacher's PC connected to an overhead projector to guide laboratory exercises

Office hours

See the website of Stefano Lodi

SDGs

Industry, innovation and infrastructure

This teaching activity contributes to the achievement of the Sustainable Development Goals of the UN 2030 Agenda.