460 | | |
| 460 | == **[[span(style=color: #BF1B1B, 10:)]]** |
| 461 | |
| 462 | {{{ |
| 463 | WITH student_ratings AS ( |
| 464 | SELECT |
| 465 | s.student_id, |
| 466 | AVG(fb.fb_rating) AS student_rating |
| 467 | FROM |
| 468 | student s |
| 469 | JOIN |
| 470 | gives_feedback gf ON gf.student_id = s.student_id |
| 471 | JOIN |
| 472 | feedback fb ON gf.fb_id = fb.fb_id |
| 473 | AND EXTRACT(YEAR FROM fb.fb_date) = EXTRACT(YEAR FROM CURRENT_DATE) |
| 474 | GROUP BY |
| 475 | s.student_id |
| 476 | ) |
| 477 | |
| 478 | SELECT |
| 479 | AVG(student_rating) AS average_student_rating |
| 480 | FROM |
| 481 | student_ratings; |
| 482 | |
| 483 | }}} |