So i'm trying to find a monthly average of unit tests my employer runs. The table consists of test id, start date, end date, total tests, duration l, pass total , fail total and pass perc
. I'm not sure how to pull this off (i'm a new apprentice)
I've tried a couple or suggestions :
SELECT AVG(a.COUNT) AS avg
from (
select count (*) as count, month(Passed) as month
from UnitTestRun
group by mnth
) as a
select count(*)/count(distinct month('EndDate')) from UnitTestRun
Edit: Test id: 10 Start date: 2022-02-07 End date: 2022-02-07 Total tests: 507 Dduration: 868600000 Pass total: 495 Fail total: 12 Pass perc: 97.63
Feburary average = ...%
By categorizing the data by month and averaging the numbers, one may determine the average number of unit tests performed each month.
By averaging the pass % field in the table, the second query determines the total average pass percentage.