Difference between revisions of "Module Feedback"

From SQLZOO
Jump to: navigation, search
(Find the modules studied by a student)
Line 19: Line 19:
  
 
<source lang='sql' class='def'>
 
<source lang='sql' class='def'>
SELECT CAM_SMO.MOD_CODE
+
SELECT CAM_SMO.MOD_CODE,INS_MOD.MOD_NAME
   FROM INS_SPR JOIN CAM_SMO ON (INS_SPR.SRP_CODE=CAM_SMO.SPR_CODE)
+
   FROM INS_MOD JOIN CAM_SMO ON (INS_MOD.MOD_CODE=CAM_SMO.MOD_CODE)
   WHERE INS_SPR.SPR_CODE='50200100'
+
   WHERE CAM_SMO.SPR_CODE='50200100'
 
   AND CAM_SMO.AYR_CODE='2016/7'
 
   AND CAM_SMO.AYR_CODE='2016/7'
 
   AND CAM_SMO.PSL_CODE='TR1'
 
   AND CAM_SMO.PSL_CODE='TR1'
 
</source>
 
</source>
 
</div>
 
</div>

Revision as of 10:34, 9 March 2017

This system records the responses of students on their learning experience at university.

Most students study three modules every session, they are invited to respond to 19 questions regarding their experience. For each question, for each student the response can be from 1 (definitely disagree) to 5 (strongly agree).

Find the student name from a matriculation number

Find the name of the student with number 50200100

SELECT SPR_FNM1, SPR_SURN
  FROM INS_SPR
  WHERE SPR_CODE='50200100'

Find the modules studied by a student

Show the module code and module name for modules studied by the student with number 50200100 in session 2016/7 TR1

SELECT CAM_SMO.MOD_CODE,INS_MOD.MOD_NAME
  FROM INS_MOD JOIN CAM_SMO ON (INS_MOD.MOD_CODE=CAM_SMO.MOD_CODE)
  WHERE CAM_SMO.SPR_CODE='50200100'
   AND CAM_SMO.AYR_CODE='2016/7'
   AND CAM_SMO.PSL_CODE='TR1'