Many of the answers to your questions can be found in the manual. However ...
1) An SQL query with DISTINCT(column_name) will return only results where column_name is different from all the other values in the column. If there are more than one value in column_name share the same value, then it will return just one of them - usually the first one it encounters.
2) No. list() is a function. It assigns the values from the right side of the = to the variables passed to the function by position ($id and $dep in this case).
3) 'PHP_SELF' is a key name in the superglobal array $_SERVER. It's value is the name of the current document.
4) Not quite. mysql_fetch_array() is quite a bit faster, and recommended if you're fetching more than one or two rows. Unless you specify otherwise, mysql_fetch_array() returns both an indexed and an associative array of the current row of the result set. mysql_fetch_row() only returns an indexed array.
5) The dot (.) is called a qualifier it tells the database that you mean the d_id column of the depart table. If there is no doubt as to which one you mean, you can leave it and the table name out, but is required if there is more than one column with that name referenced in the query, and makes your life easier if you're SELECTing from more than one table.
6) B [/B] does nothing of value. unset() removes the value of the variable passed to it. If you asked for $num_rows after calling unset() on it, it would return with a null value (ie., the empty string: '').