I have two tables
Operators table
proportion, name, routeid
(proportion hold % value e.g 100 = 100% or 50 = 50% this shows the % of services ran by this operator)
route table
routeid, frequency
(frequency holds number of trains per hour)
What I need to do now is write a query which will sum up the number of trains per hour by certain operator where name of operator is Arriva. So if arriva runs 100% of certain service 1, and 50% of service 2 it should work that out as well.
What I was thinking it would look something like this psudo code
All arriva trains per hour = Frequency * (proportion/100)
Where Operators.name = Arriva
Try this