Advertisement
ma39isy

Untitled

Dec 12th, 2023
1,441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.     C.LECTURERCODE,
  3.                             L.EMPLOYEESNAME LECTURERNAME,
  4.                             L.TIPEDOSEN,
  5.                             C.SUBJECTCODE,
  6.                             C.COURSEID,
  7.                             C."CLASS",
  8.                             ST.STUDYPROGRAMNAME,
  9.                             S.SUBJECTNAME,
  10.                             C.SUBJECTCODE || '-' || S.SUBJECTNAME || '-' || C."CLASS" COURSESUBJECT,
  11.                             NVL(ROUND((TOTALDONE / NVL(TOTAL, 1))* 100, 2), 0) PERSENTASE,
  12.     TOTALDONE,
  13.     TOTAL
  14. FROM
  15.                             COURSE C
  16. JOIN SUBJECTS S ON
  17.     (S.SUBJECTID = C.SUBJECTID)
  18. LEFT JOIN LECTURERVIEW L ON
  19.     (L.LECTURERCODE = C.LECTURERCODE)
  20. JOIN STUDYPROGRAM ST ON
  21.     (C.STUDYPROGRAMID = ST.STUDYPROGRAMID)
  22. LEFT JOIN (
  23.     SELECT
  24.         SUBJECTID,
  25.         SCHOOLYEAR,
  26.         SEMESTER,
  27.         COUNT(B.ID) TOTAL
  28.     FROM
  29.                                 CLO_MATERIAL_TEACHING A
  30.     JOIN CLO_TEACHING_PLANS B ON
  31.         (CLO_LEARNING_PLAN_ID = B. ID)
  32.     WHERE
  33.                                 SCHOOLYEAR = '2324'
  34.         AND SEMESTER = '1'
  35.         AND
  36.                                 A. ACTIVE_STATUS = '1'
  37.         AND B. ACTIVE_STATUS = '1'
  38.         AND B. APPROVAL_STATUS = 'A'
  39.     GROUP BY
  40.         SUBJECTID,
  41.         SCHOOLYEAR,
  42.         SEMESTER
  43.                             ) SL ON
  44.     (SL.SUBJECTID = C.SUBJECTID
  45.         AND SL.SCHOOLYEAR = C.SCHOOLYEAR
  46.         AND SL.SEMESTER = C.SEMESTER)
  47. LEFT JOIN (
  48.     SELECT
  49.         LECTURES.COURSEID,
  50.         COUNT(DISTINCT CLO_MATERIAL_TEACHING_ID) TOTALDONE
  51.     FROM
  52.         LECTURES_CLO_MATERIAL_TEACHING
  53.     JOIN LECTURES
  54.             USING (LECTURESID)
  55.     JOIN CLO_MATERIAL_TEACHING A ON
  56.         (CLO_MATERIAL_TEACHING_ID = A.ID)
  57.     JOIN CLO_TEACHING_PLANS B ON
  58.         (CLO_LEARNING_PLAN_ID = B. ID)
  59.     WHERE
  60.         LECTURES.SCHOOLYEAR = '2324'
  61.         AND LECTURES.SEMESTER = '1'
  62.         AND A. ACTIVE_STATUS = '1'
  63.         AND B. ACTIVE_STATUS = '1'
  64.         AND B. APPROVAL_STATUS = 'A'
  65.     GROUP BY
  66.         LECTURES.COURSEID) SD ON
  67.     (SD.COURSEID = C.COURSEID)
  68. WHERE
  69.     C.SCHOOLYEAR = '2324'
  70.     AND C.SEMESTER = '1'
  71.     AND C.LECTURERCODE IN (
  72.     SELECT
  73.         LECTURERCODE
  74.     FROM
  75.         LECTURER
  76.     WHERE
  77.         EMPLOYEEID = '21920018-3')
  78. ORDER BY
  79.     PERSENTASE DESC;
  80.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement