Question: - This time, MoMA is interested in looking at the gender breakdown of artists in its collection. - Create an SQL query that: selects the

 - This time, MoMA is interested in looking at the gender

- This time, MoMA is interested in looking at the gender breakdown of artists in its collection. - Create an SQL query that: selects the count of records per gender. - This data can be found in the gender property of the JSON structures stored in the info column of the moma_artists table. filters out the NULL values. names the selected columns gender and count. sorts the result by gender. - Construct your query based on the above description. - Tips: - Use the - >> JSON operator to extract the gender as text (as opposed to binary, since info is a JSONB column). Care must be taken to make the grouping of genders case-insensitive. Pass the selected genders through the UPPER function before grouping. Task 4: Part 2 - Test your query - Use the next code cell to test your query. Add your query within the multiline string assigned to the query variable, then run the cell. If your query is correctly constructed, you should see: ('FEMALE', 53) ('MALE', 309)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!