G is for free tickets other than MP. For example, if UA has an incentive for travel agents who book a certain volume, those tickets are booked in G. M, H, Q, V, and W are typically all discount economy, non-refundable but at different fare levels with different advance purchase requirements. Usually W is the lowest fare with longest advance purchase restrictions, V next, then Q etc. Not all fare codes will be available in all markets. And fare codes even within a given market will change from time to time, especially if there is a sale.
Within a given code - e.g., Q - there may be more than 1 fare basis (the letters after the Q). For example, 1 Q fare basis may be valid Tues, Wed, Sat while other Q fares are valid other days of the week.