I have a simple table. It's format is:
Column 1: Integer
Column 2: String which consists of a bunch of words separated by spaces
An example of column 2 might be: "foo bar bax bux qux"
Given 2 rows:
(1, "foo bar baz bux qux")
(2, "foo baz bux qux bax")
I would like to generate the following data-structure:
{
foo: 2,
baz: 2,
bux: 1,
qux: 2,
bax: 1
}
There will be thousands of tags.
Essentially, I want to calculate the # of occurrences of each word across all rows. What might be a good way to do this?
I can either use sqlite or duckdb.