← Back
ExamFull examExam paper onlyItalian

01 02 17s

Study material for Basi di Dati, shared by the Studwiz community and reviewed by moderators.

Basi di DatiFull exam

Document information

What's included in this study material

Study material for Basi di Dati, shared by the Studwiz community and reviewed by moderators.

Import quality: text was extracted directly from the original document.

Extracted content from the document

Representative passages recognised in different parts of the material. The full extracted text remains available to search, while this compact preview makes the page easier to read.

Page 1

BASI DI DATI 1 – PROFF. S. CERI, E. QUINTARELLI, L. TANCA – A.A. 16/17 PRIMO APPELLO – 1 FEBBRAIO 2017 TEMPO A DISPOSIZIONE: 2 h E 30 m Matricola o Codice Persona: Cognome e Nome: (IN STAMPATELLO MAIUSCOLO) Firma: Si consideri il seguente schema di base di dati, che me morizza informazioni relative ad alcune società di trasporto pubblico locale che gestiscono linee di autobus. LINEA (Società, Numero, CittàPartenza, CittàArrivo, LunghezzaKm) CORSA (Società, NumeroLinea, Orario, Data, TargaAutomezzo, CFAutista) AUTISTA (CF, Cognome, Nome, DataNascita, CittàNascita) AUTOMEZZO (Targa, CasaProduttrice, Cilindrata, NumPostiASedere) L’attributo Società, nelle diverse relazioni, è una stringa contenente il nome della società che opera la linea. La relazione CORSA contiene uno storico delle assegnazioni di autobus e autisti alle varie corse; l ’attributo Orario si riferisce alla partenza dal capolinea. Si precisa che la relazione AUTISTA può contenere anche autisti neoassunti, che non hanno ancora effettuato viaggi. A. Linguaggi formali (6 punti) Esprimere in algebra relazionale, calcolo relazionale e Datalog la seguente interrogazione: Trovare codice fiscale, cognome e nome degli autisti che hanno guidato su una e una sola linea. Algebra relazionale Corsa Corsa Corsa (S, L) ß(Società, NumeroLinea) CFAutista Società, NumeroLinea, CFAutista Società. NumeroLinea, CFAutista - Autista CF, Cognome, Nome CF=CFAutista CFAutista LaNumeroLine SSocietà   Calcolo relazionale {t | ∃t1∈Autista, ∃t2∈Corsa (t[CF, Cognome, Nome]=t1[CF, Cognome, Nome] ∧ t1[CF]=t2[CFAutista] ∧ ¬ (∃t3∈Corsa, ∃t4∈Corsa (t3[CFAutista]=t1[CF] ∧ t3[CFAutista]=t4[CFAutista] ∧ (t3[NumeroLinea]≠t4[NumeroLinea] ∨ t3[Società]≠t4[Società]))))} Oppure {t | ∃t1∈Autista, ∃t2∈Corsa (t[CF, Cognome, Nome]=t1[CF, Cognome,…

Preview

First page of the document.

First page: 01 02 17s