SQL Saturday

This is a short post but the problems were still pretty fun!

Types of Triangles:

Given the table of triangles, sides find if a triangle is possible. If so then find the type of triangle that exists.



An OCCUPATIONS table that contains the following records:

Generate the following two result sets:

  1. 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). For example: AnActorName(A), ADoctorName(D), AProfessorName(P), and ASingerName(S).
  2. Query the number of ocurrences of each occupation in OCCUPATIONS. Sort the occurrences in ascending order, and output them in the following format: