QuizzesJSON Data Type & Functions — Concept Check
intermediate
mysql

JSON Data Type & Functions — Concept Check

Questions on JSON Data Type & Functions. MySQL 5.7+ stores JSON as a binary type with path expressions (->>, JSON_EXTRACT, JSON_SET); generated virtual columns on JSON paths can be indexed for efficient JSON queries.

8 minutes 8 questions Pass at 70%
Time Limit
8 minutes - timer starts when you begin
Change Answers Freely
Revisit and change any answer before submitting
Full Review After Submit
Correct answers and explanations shown for every question
Auto-submit on timeout
Quiz submits automatically when time runs out

Questions in this quiz

8 questions on JSON Data Type & Functions — Concept Check. Work through them here, then start the quiz to answer them and see your score.

  1. 1.A developer needs to update the 'price' field in a JSON column without rewriting the entire document. Which function should they use?

    • AJSON_SET
    • BJSON_REMOVE
    • CJSON_REPLACE
    • DJSON_EXTRACT
  2. 2.You want to index the 'color' attribute in a JSON column for faster queries. What is the correct approach?

    • AUse JSON_EXTRACT to index
    • BCreate a virtual generated column and index it
    • CDirectly index the JSON column
    • DIndex using JSON_SET
  3. 3.A query using `attributes->>'$.color' = 'red'` is slow. How can indexing improve it?

    • AApply JSON_REPLACE to optimize
    • BIndex the JSON column directly
    • CCreate a virtual column for 'color' and index it
    • DUse JSON_MERGE_PATCH for indexing
  4. 4.A table has a JSON column with an array. How can you efficiently check if 'sale' is in the array?

    • AApply JSON_REMOVE first
    • BUse MEMBER OF and a multi-value index
    • CUse JSON_SET to add 'sale'
    • DDirectly query with JSON_EXTRACT
  5. 5.A developer mistakenly believes JSON columns can be indexed directly. What is the correct method?

    • AIndex using JSON_SET
    • BApply JSON_REMOVE for indexing
    • CUse virtual generated columns for indexing
    • DDirectly index the JSON column
  6. 6.When inserting a JSON document, what ensures its structure is valid?

    • AJSON_SET ensures valid structure
    • BJSON_EXTRACT checks structure
    • CMySQL validates JSON structure on insert
    • DJSON_REMOVE validates structure
  7. 7.A developer uses JSON_TABLE to convert JSON arrays to relational rows. What is a common use case?

    • ARemoving keys from JSON
    • BNormalizing semi-structured data inline
    • CIndexing JSON arrays directly
    • DUpdating JSON paths efficiently
  8. 8.Which operator returns an unquoted string from a JSON path?

    • A->>
    • BJSON_EXTRACT
    • C->
    • DJSON_SET