I have two tables "cats_lables" and "classified_cats", where in "cats_lables" table I can only add a new classes/lables of cats. And then I can use this class/lable to classify new cats and add them to the table "classified cats".
so the tables are like this:
cats_lables:
id cats_lable
1 Polydactyl
2 Snowshoe
3 Calico
classified_cats:
id class_id cat_age placeOfBorn cat_price
1 1 3 months Eygipt 1000
2 3 6 months Lebanon 2000
so, this is the query that shows only the cats that have been classified:
SELECT "cats_lables".*,
CAST(COUNT("classified_cats"."class_id") AS int) AS class_count
FROM "Labels"
INNER JOIN "classified_cats"
ON "classified_cats"."class_id"="cats_lables"."id"
GROUP BY "cats_lables"."id"
ORDER BY class_count DESC
But I want to upgrade my query to show also the cat class even if there is no cat assigned to it.
how can I fix my query?