A few corrections and additions... P on UA and a few other airlines is a "premium" first,not "discounted". Business is almost consistently C or J depending on the airline. Among each class there are various fare bases, which are set individually by airlines, although within the various alliances, some sort of consistency is starting to develop. (Oneworld had some recent coordination.) You really have to be familiar with the airline(s) you fly. The Concorde has its own booking classes. Various airlines have various sequences of what fare code has more "priority" (and accordingly, often higher fare). Within UA, the basic sequence is F(P)/A C/D Y/B/H/M/Q/V/W. This will not be consistent with other airlines, except that if you hear someone talking of F class, its first, C or J is business, and Y is (generic) economy.
Some airlines have their upgrade and free inventory among standard (published) codes, and others don't. UA does not, and it is not viewable by anyone outside the UA system. Many other airlines do, and any travel agent, or your United Connection link can show you what seats are available in what booking classes. For instance, you can find out availability for a free LH ticket if you know their codes (A - First / Z- Business, etc.) Or AS (A - Free or upgraded First if not an MVP Gold) and so on.
UA is the most elusive, and even "clues" to determine upgrade and free availability are becoming hard to predict, based upon a very sophisticated inventory management system (that had some serious bugs in its original implementation, leading to empty seats for a short while).
Hope this helps.