Advertisement
ma39isy

Untitled

Oct 23rd, 2023
1,675
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 ( S.SUBJECTID = C.SUBJECTID )
  17.     LEFT JOIN LECTURERVIEW L ON ( L.LECTURERCODE = C.LECTURERCODE )
  18.     JOIN STUDYPROGRAM ST ON ( C.STUDYPROGRAMID = ST.STUDYPROGRAMID )
  19.     LEFT JOIN (
  20.     SELECT
  21.         SUBJECTID,
  22.         SCHOOLYEAR,
  23.         SEMESTER,
  24.         COUNT( B.ID ) TOTAL
  25.     FROM
  26.         CLO_MATERIAL_TEACHING A
  27.         JOIN CLO_TEACHING_PLANS B ON ( CLO_LEARNING_PLAN_ID = B.ID )
  28.     WHERE
  29.         SCHOOLYEAR = '2324'
  30.         AND SEMESTER = '1'
  31.         AND A.ACTIVE_STATUS = '1'
  32.         AND B.ACTIVE_STATUS = '1'
  33.         AND B.APPROVAL_STATUS = 'A'
  34.     GROUP BY
  35.         SUBJECTID,
  36.         SCHOOLYEAR,
  37.         SEMESTER
  38.     ) SL ON ( SL.SUBJECTID = C.SUBJECTID AND SL.SCHOOLYEAR = C.SCHOOLYEAR AND SL.SEMESTER = C.SEMESTER )
  39.     LEFT JOIN (
  40.     SELECT
  41.         LECTURES.COURSEID,
  42.         COUNT( DISTINCT CLO_MATERIAL_TEACHING_ID ) TOTALDONE
  43.     FROM
  44.         LECTURES_CLO_MATERIAL_TEACHING
  45.         JOIN LECTURES USING ( LECTURESID )
  46.         JOIN CLO_MATERIAL_TEACHING A ON ( CLO_MATERIAL_TEACHING_ID = A.ID )
  47.         JOIN CLO_TEACHING_PLANS B ON ( CLO_LEARNING_PLAN_ID = B.ID )
  48.     WHERE
  49.         LECTURES.SCHOOLYEAR = '2324'
  50.         AND LECTURES.SEMESTER = '1'
  51.         AND A.ACTIVE_STATUS = '1'
  52.         AND B.ACTIVE_STATUS = '1'
  53.         AND B.APPROVAL_STATUS = 'A'
  54.     GROUP BY
  55.         LECTURES.COURSEID
  56.     ) SD ON ( SD.COURSEID = C.COURSEID )
  57. WHERE
  58.     C.SCHOOLYEAR = '2324'
  59.     AND C.SEMESTER = '1'
  60.     AND C.STUDYPROGRAMID = '31'
  61. ORDER BY
  62.     PERSENTASE DESC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement