The inner query, which you have asked in the end of the question does the below:
For each tuple in employee database, the query outputs minimum salary of a department in which the employee is working.
Now coming to the main query, it will output those employee's name and department Id whose salary is greater than minimum salary in their department.
Here minimum salary of department 1 is 5000, so we get Sowmya and Srinu.
In department 2,3 and 4 minimum salary is 30000, 50000 and 60000 respectively and for these departments there are no employees whose salary is greater than the minimum salary, so they are not included.