title: SQL query to print occupation with print name with order
body: <p>Query an alphabetically ordered list of all names in OCCUPATIONS, immediately followed by the first letter of each profession as a parenthetical (i.e.: enclosed in parentheses). </p>
  
  <p>For example: </p>
  
  <pre><code>AnActorName(A), ADoctorName(D), AProfessorName(P), and ASingerName(S)
  </code></pre>
  
  <p>Query the number of occurrences of each occupation in OCCUPATIONS. Sort the occurrences in ascending order, and output them in the following format: </p>
  
  <pre><code>SELECT name||'('||SUBSTR(occupation, 1, 1)||')'
  FROM occupations
  ORDER BY name
  
  UNION
  
  SELECT "There are a total of"|| count(*) from occupations group by occupation;
  </code></pre>