Basi di dati:soluzioni??
Posted by Alis on 09-02-2003 20:23
Abbiamo fatto degli esercizi, ma non siamo sicuri dei risultati, ci potete dire se sono giusti?
Grazie!!!!!!!!!!!!!
Esame 13/01/03:
Esercizio 1:
A) SELECT DISTINCT IndirizzoFornitore
FROM Computer, Installazione
WHERE Computer.CodComputer=Installazione.CodComputer
AND descrizioneSoftware="database";
B) SELECT Marca, Modello, COUNT(CodComputer)
FROM Computer
GROUP BY Marca, Modello;
C) SELECT CodFornitore, MAX(COUNT(CodComputer))
FROM Computer
GROUP BY CodFornitore;
Esercizio 3:
CREATE TABLE R1(K Integer not null, A Integer)
PRIMARY KEY (K);
GRANT SELECT ON R1 TO Rossi;
CREATE TABLE R2(K Integer not null, B Integer)
PRIMARY KEY (K);
GRANT SELECT ON R2 TO Rossi;
INSERT INTO R1(K, A)
SELECT K, A
FROM R;
INSERT INTO R2(K, B)
SELECT K, B
FROM R;
DROP TABLE R;
CREATE VIEW R(K, A, B) AS
SELECT K, A, B
FROM R1, R2
WHERE R1.K=R2.K;
Esame 11/6/99:
Esercizio 1:
SELECT MAX(Prezzo), MIN(Prezzo), Nome
FROM Vendite, Auto, Venditori
WHERE Venditori.Vcod=Vendite.Vcod AND Auto.Acod=Vendite.Acod
AND Età <30 AND Marca="Toyota" AND Modello="Carina"
GROUP BY Nome;
Esame 20/6/02:
Esercizio 1:
B) SELECT Autore#, MIN(COUNT(Libro#))
FROM Libri, Prestiti
WHERE Libri.Libro#=Prestiti.Libro#
GRUOP BY Autore#;
C) DELETE FROM Libri
WHERE Argomento-Principale="Teoria degli Algoritmi"
Libro IN (SELECT Libro FROM Prestiti
WHERE Nome-Utente="Rossi");
Esame 2/9/02:
Esercizio 1: A) SELECT DISTINCT IndirizzoFornitore
FROM Computer, Installazione
WHERE Computer.CodComputer=
Installazione.CodComputer AND
dataInstallazione < #1/1/95#;
Powered by: vbHome (lite) v3.8 and vBulletin v2.3.1
Copyright © 2000 - 2002 Jelsoft Enterprises Limited