← Back
ExamFull examExam paper onlyItalian

22 06 18s

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, G. POZZI, E. QUINTARELLI, L. TANCA – A.A. 2017/2018 TERZO APPELLO – 22 GIUGNO 2018 TEMPO A DISPOSIZIONE: 2 h E 30 m Si consideri il seguente schema di base di dati nell’ambito dei brevetti: BREVETTO (IdBrevetto, Titolo, Descrizione, Categoria, Data) REGIONE (IdRegione, NomeRegione, Nazione) INVENTORE (IdInventore, Cognome, Nome, DataNascita, IdRegione) BREVETTOINVENTORE (IdBrevetto, IdInventore) Si noti che un brevetto può essere associato a più inventori. Gli identificatori di brevetti e inventori sono codici alfanumerici con una lunghezza fissata pari a 20 caratteri. L’identificatore della regione, invece, è un codice alfanumerico con lunghezza massima pari a 7 caratteri. A. Linguaggi formali (6 punti) Esprimere in algebra relazionale, calcolo relazionale e Datalog la seguente interrogazione: Trovare id, cognome e nome degli inventori con almeno tre brevetti. Algebra relazionale Brevetto Inventore B1  IdBrevetto Brevetto Inventore B2  IdBrevetto Brevetto Inventore B3  IdBrevetto B1 B2 B3 B1 Λ B3 B2 IdInventore Inventore IdInventore, Cognome, Nome Calcolo relazionale {t | ∃t1∈Inventore, ∃t2∈BrevettoInventore, ∃t3∈BrevettoInventore, ∃t4∈BrevettoInventore (t[IdInventore, Cognome, Nome]=t1[IdInventore, Cognome, Nome] Λ t1[IdInventore]=t2[IdInventore] Λ t2[Inventore]=t3[IdInventore] Λ t3[IdInventore]=t4[IdInventore] Λ t2[IdBrevetto]≠t3[IdBrevetto] Λ t2[IdBrevetto]≠t4[IdBrevetto] Λ t3[IdBrevetto]≠t4[IdBrevetto])} Datalog Inv3Brev(id, c, n) :- Inventore(id, c, n, _, _), BrevettoInventore(b1, id), BrevettoInventore(b2, id), BrevettoInventore(b3, id), b1<>b2, b1<>b3, b2<>b3 ?- Inv3Brev(x, y, z) B. Interrogazioni SQL (10 punti) 1. Trovare id, cognome, nome e numero di brevetti degli inventori italiani che non hanno mai ottenuto brevetti la…

Preview

First page of the document.

First page: 22 06 18s