これを試してください:
1行で:
SELECT SUM(Class.Students * Books.Cost) AS BookCost FROM Books INNER JOIN Class ON Books.ClassId = Class.ClassId WHERE Books.ClassId = <CLASS-ID-VALUE> GROUP BY Books.ClassId
フォーマットあり:
SELECT SUM(Class.Students * Books.Cost) AS BookCost
FROM Books INNER JOIN Class
ON Books.ClassId = Class.ClassId
WHERE Books.ClassId = <CLASS-ID-VALUE>
GROUP BY Books.ClassId