<slide>
<title>MySQL: Query JSON object</title>

<blurb>Create and Insert:</blurb>
<example>
CREATE TABLE whisky (name VARCHAR(255), props JSON);

INSERT INTO whisky VALUES
  ( "Glen Albyn 24", '{"age": 24, "cask_strength": false, "abv": 47.5 }' ),
  ( "Glenrothes 24", '{"age": 24, "cask_strength": true, "coloured": false }' );
</example>

<break/>
<blurb>Query:</blurb>
<example inline="2">
SELECT name, *props->>"$.age"* FROM whisky WHERE *props->"$.cask_strength" = true*;
</example>

<break/>
<blurb>Result:</blurb>
<example>
+-------------------------+---------------------+
| name                    | props->"$.age"      |
+-------------------------+---------------------+
| Glenrothes 24           | 24                  |
+-------------------------+---------------------+
</example>
</slide>
