Stand alone schema or something else?

I’m building an application where I need to store how many people in
certain age groups live in a home. For example, the paper form looks like this. Where the user would
write in number next to the age group.

0-5 __
6-12 __
13-18 __
19-25 __
26-39 __
40-55 __
55+ __

I’m unsure of how to persist this data. I could do something like the following but it seems clunky.
Can anyone suggest a better way to do this?

defmodule Pantry.Household do

 schema "household_member_age_groups" do
  field :0_5, integer
  field :6-12, integer
  field :13_18, integer
  field :address, string


@_russellb: I suggest you such schemas:

defmodule Pantry.HouseholdMember do
  use Ecto.Schema

  alias Pantry.Address

  schema "household_members" do
    belongs_to :address, Address
    field :age, :integer

defmodule Pantry.Address do
  use Ecto.Schema

  alias Pantry.HouseholdMember

  schema "addresses" do
    has_many :members, HouseholdMember
    field :data, :string

For age groups simply use combination of Ecto.Query.API.count/1 and Ecto.Query.where/3 like:

alias Pantry.{HouseholdMember, Repo}

import Ecto.Query

group_from = 0
group_to = 5

query = from(
  m in HouseholdMember,
  select: count(m.age),
  where: m.age >= ^group_from,
  where: m.age <= ^group_to

In such way you will have a better control of your data in future.

TIP: You can also use Ecto.Query.API.fragment/1 to call PostgreSQL BETWEEN comparison predicate.

Yes, that is a solution thank you. I need to present the age groups in the UI for the user to choose from. The age group data has the shape of a map to me. I feel myself trying to couple the UI with the data layer, which I know is wrong, but easier to do at my level of skill.