1. For all the accounts that have authority="admin", set permision to modify all of the files (attribute changes is datatype YES/NO),,, so basically a user can set yes or no depends on his will.

  2. For each directory, print out his name, in which directory it is located, and how many subdirectories does it have. It is necessary to print out those directories which aren t found in a directory(don t have parentdirectories) and those whith no subdirectories

  3. Find 10% of the largest directories wich do not have subdirectories. The size of the directory without the subdirectory is equal to the sum of size of all directories wich are inside the directory. Write out directoryID, name of the directory and size.

This is what i have tried so far but i m really confused with this ones.

1) SELECT * FROM accounts WHERE  authorities="admin" ....

3) not sure about this one( i know that i should use count and group by,,, not sure about the location as well)

5) SELECT TOP 10 PERCENT direktoriID,name,size FROM direktori WHERE direktori.direktoriID= FILE.DIRECTORYid AND parentdirectoryID=NULL

So if you could please help out with that.
here is a picture of the ER model(using ms Access)

if anyone can give me a link or a hint on how to approach these queries, i m not asking for direct solutions. the only thing that i really don t know how to solve is the 1. query so this woulb be of imense help if you gave me a hint

ok the first one was ridiculous(i miss understood it) but the last one was the problem.
1.)

UPDATE ovlasti INNER JOIN racuni ON racuni.username=ovlasti.username SET       izmjena = yes
WHERE racuni.ovlasti='admin';

5.)

SELECT TOP 10 PERCENT direktorij.direktorijID, direktorij.naziv, SUM(datoteka.velicina) AS velicina FROM datoteka INNER JOIN direktorij ON datoteka.direktorijID=direktorij.direktorijID

WHERE direktorij.direktorijID IN (SELECT direktorijID FROM direktorij WHERE direktorij.direktorijID NOT IN (SELECT nadDirektorijID FROM direktorij WHERE nadDirektorijID IS NOT NULL))

GROUP BY direktorij.direktorijID, direktorij.naziv ORDER BY SUM(datoteka.velicina) DESC;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.