Answered step by step
Verified Expert Solution
Question
1 Approved Answer
- 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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started