/* Cancellare le directory vuote */

DROP TABLE IF EXISTS Padri;
CREATE TEMPORARY TABLE Padri AS
       SELECT f.Padre
       FROM   File f;

DELETE FROM File
WHERE Id IN (SELECT * FROM Directory)
   	 AND Id NOT IN (SELECT * FROM Padri);

/* Mostra le directory rimanenti */
SELECT * 
FROM   FileDir;


SOURCE FileSystem.sql