# Music Library ```elixir Mix.install([ {:kino_db, "~> 0.2.10"}, {:exqlite, "~> 0.23.0"} ]) ``` ## Setup ```elixir opts = [ database: "/Users/cloud/github.com/cloud8421/music_library/data/music_library_dev.db" ] {:ok, conn} = Kino.start_child({Exqlite, opts}) ``` ## Aggregates ### Count of records per artist ```elixir result = Exqlite.query!( conn, ~S""" select json_extract(artist.value, '$.name') as name, count(1) as c from records, json_each(records.artists) artist group by name order by c desc ; """, [] ) ``` ### Count of records by genre ```elixir result2 = Exqlite.query!( conn, ~S""" select genre.value, count(genre.value) as c from records, json_each(records.genres) genre group by genre.value order by c desc ; """, [] ) ```