title: sql; percent distribution with counted values
body: <p>I have a table (Salaries) with salaries distributed on gender and job titel.
  I want to show the results on gender for every job titel I have in my database plus the total value. For example for the first titel I have this code:</p>
  
  <pre><code>select 'Female' as '____',
         count(gender) as Number,
         SUM(Salary) AS Total_Salary,
         MIN(salary) AS Min_salary,
         AVG(salary) AS Avg_Salary,
         MAX(salary) AS Max_Salary
  from Salaries
  where gender= 'Female'
    And Job_titel='Adm assistent'
  union (
  select 'Man' as '____',
         count(gender) as Number,
         SUM(Salary) AS Total_Salary,
         MIN(salary) AS Min_salary,
         AVG(salary) AS Avg_Salary,
         MAX(salary) AS Max_Salary
  from Salaries
  where gender= 'Man'
    AND Job_titel='Adm assistent')
  union (
  select 'Total' as '____',
         count(gender) as Number,
         SUM(Salary) AS Total_Salary,
         MIN(salary) AS Min_salary,
         AVG(salary) AS Avg_Salary,
         MAX(salary) AS Max_Salary
  from Salaries
  where Job_titel ='Adm assistent' )
  </code></pre>
  
  <h2>The table:</h2>
  
  <pre><code>  ____  Number Tot_Salaries Min_Salaries Avg_Salaries Max_Salaries
  ----------------------------------------------------------
  
  Female    142      1 000 000          XXXXXX         XXXXXXX      XXXXXXX  
  Male       18        300 000          XXXXXX         XXXXXXX      XXXXXXX
  Total     160      1 300 000          XXXXXX         XXXXXXX      XXXXXXX
  ----------
  </code></pre>
  
  <p>Now I want the table to have the distribution in % for gender an salaries like this:</p>
  
  <pre><code>   ___  Number %_Gender Tot_Salaries %  Min_Salaries Avg_Salaries Max_Salaries
  
  Female    142    89     1 000 000   77   XXXXXX      XXXXXXX     XXXXXXX  
  Male       18    11       300 000   13   XXXXXX      XXXXXXX     XXXXXXX
  Total     160   100     1 300 000   00   XXXXXX     XXXXXXX      XXXXXXX
  ----------
  </code></pre>
  
  <p>How do I get this two distrubution values? I Think my code maybe is quite ineffective right now:-)I use MS sql server.</p>