MySql | How to compute this
SELECT SUM(Grade * (Lec + Lab)) / SUM(Lec + Lab) FROM t;




| SUM(Grade * (Lec + Lab)) / SUM(Lec + Lab) |
| ----------------------------------------: |
|                                       1.5 |



db&lt;>fiddle here