Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Extract User Interests | JSON Functions
Functions in SQL

bookChallenge: Extract User Interests

After learning the essentials of JSON functions in SQL, you are ready to tackle a practical challenge that involves working with structured data stored in a JSON column. The user_profiles table contains user information, where the profile_data column holds JSON objects. Each object includes user attributes such as age, address, and most importantly for this task, an interests array. Your goal is to extract this interests array for each user using SQL's JSON functions.

Oppgave

Swipe to start coding

Write a query to retrieve each user's user_id and the corresponding interests array from the profile_data JSON column in the user_profiles table.

  • Select the user_id column.
  • Extract the interests array from the profile_data JSON column.
  • Return one row per user, including both the user_id and extracted interests array.

Løsning

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 6. Kapittel 2
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

close

bookChallenge: Extract User Interests

Sveip for å vise menyen

After learning the essentials of JSON functions in SQL, you are ready to tackle a practical challenge that involves working with structured data stored in a JSON column. The user_profiles table contains user information, where the profile_data column holds JSON objects. Each object includes user attributes such as age, address, and most importantly for this task, an interests array. Your goal is to extract this interests array for each user using SQL's JSON functions.

Oppgave

Swipe to start coding

Write a query to retrieve each user's user_id and the corresponding interests array from the profile_data JSON column in the user_profiles table.

  • Select the user_id column.
  • Extract the interests array from the profile_data JSON column.
  • Return one row per user, including both the user_id and extracted interests array.

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 6. Kapittel 2
single

single

some-alt