1.The example shows the number who responded for:
question 1
at ‘Edinburgh Napier University’
studying ‘(8) Computer Science’
Show the the percentage who STRONGLY AGREE
SELECT round(A_STRONGLY_AGREE/
(A_STRONGLY_DISAGREE+
A_DISAGREE+
A_NEUTRAL+
A_AGREE+
A_STRONGLY_AGREE)*100,0)
FROM nss
WHERE question='Q01'
AND institution='Edinburgh Napier University'
AND subject='(8) Computer Science'
- 用到之前有一章里用过的取百分比的方法。
2.Show the institution and subject where the score is at least 100 for question 15.
SELECT institution,subject
FROM nss
WHERE question='Q15'
AND score>=100
3.Show the institution and score where the score for ‘(8) Computer Science’ is less than 50 for question ‘Q15’