Challenge: Find Users by City
Oppgave
Swipe to start coding
Write a query to find users whose address city in the profile_data JSONB column is 'New York' using PostgreSQL JSON operators.
- Query the
user_profilestable. - Use PostgreSQL JSON operators (
->and->>) to access the nestedcityfield inside theaddressobject in theprofile_datacolumn. - Filter for rows where the
address.cityvalue is'Springfield'. - Return the
user_idandprofile_datacolumns for all matching users.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 6. Kapittel 3
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Suggested prompts:
Can you explain this in simpler terms?
What are the main points I should remember?
Can you give me an example?
Fantastisk!
Completion rate forbedret til 2.86
Challenge: Find Users by City
Sveip for å vise menyen
Oppgave
Swipe to start coding
Write a query to find users whose address city in the profile_data JSONB column is 'New York' using PostgreSQL JSON operators.
- Query the
user_profilestable. - Use PostgreSQL JSON operators (
->and->>) to access the nestedcityfield inside theaddressobject in theprofile_datacolumn. - Filter for rows where the
address.cityvalue is'Springfield'. - Return the
user_idandprofile_datacolumns for all matching users.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 6. Kapittel 3
single