The question word "duōshao多少" (how many; how much) means "how much" or "how many", and note that "多少" cannot be replaced by "jǐ 几" (how much) in this case. They are different in that, firstly, "几" is usually used to ask about numbers within ten, whereas "多少" has a wider range of applications, and can be used to ask about numbers within or outside ten, and secondly, even if all the numbers are known to be within ten, the measure word "ge 个" must be used in between "几" and "xuésheng 学生" (student), and cannot be omitted, whereas "多少" and "学生" can be used directly in conjunction with each other, and the measure word can be omitted.
"zhǐ 只" (only) is an adverb used to emphasize the restriction or limited number of a quantity. "只有" (only have) is a fixed collocation often used to emphasize a small number of things, similar to "zing6 hai6 dak1 淨係得" in Cantonese.