SELECT CATEGORY, SUM(S.SALES) TOTAL_SALES
FROM BOOK JOIN (
SELECT BOOK_ID, SALES
FROM BOOK_SALES
WHERE SALES_DATE LIKE '2022-01%') S
ON BOOK.BOOK_ID = S.BOOK_ID
GROUP BY CATEGORY
ORDER BY CATEGORY
SELECT CATEGORY, SUM(S.SALES) TOTAL_SALES
FROM BOOK JOIN (
SELECT BOOK_ID, SALES
FROM BOOK_SALES
WHERE TO_CHAR(SALES_DATE, 'YYYY-MM') LIKE '2022-01') S
ON BOOK.BOOK_ID = S.BOOK_ID
GROUP BY CATEGORY
ORDER BY CATEGORY