Analyze passenger data to classify first names by popularity. The passenger_name column in the tickets table contains full names with first and last name divided by a space. Extract the passenger's first names, count the occurrences of each first name and classify names into 3 popularity groups: Most Popular, Moderately Popular, and Least Popular Output results in the table with next columns: - first_name - extracted first name in uppercase - occurrences_count - number of the name occurrences - popularity - popularity classification (Most Popular, Moderately Popular, or Least Popular) sorted by popularity count (descending), then by first name (alphabetically).
Write your request in the field below and click the "Check it!" button.
Use PostgreSQL syntax to write your answer. Descriptions of tables are provided at the bottom of the screen.
ER diagram of the Bookings database