I have an SQL table which contains flashcard objects. The table has a column indicated whether a flashcard is free or paid. Flashcards are divided into categories. In my android app I need to display the number of flashcards which are free, and also the number of flashcards which are paid, for each category. If a flashcard isn't free, it is paid.
My SQL isn't great, so far I have a query which returns the number of flashcards which are free:
SELECT _id, category_primary, count(category_primary) FROM Flashcards WHERE available = '1' GROUP BY category_primary;
I want to try to get the count of both free and paid flashcards in a single query/cursor as I display the result in a ListView using an adapter.