SELECT m.musym AS Map_unit_symbol, m.muname AS Map_unit_name, m.muacres AS Map_unit_Acres, c.compname AS Component_name,
c.comppct_r AS Component_percentage, (m.muacres*c.comppct_r/100) AS Component_acres, cm.flodfreqcl AS Flooding_class
FROM legend AS l
INNER JOIN mapunit AS m ON m.lkey = l.lkey
LEFT OUTER JOIN component AS c ON c.mukey = m.mukey
LEFT OUTER JOIN comonth AS cm ON cm.cokey = c.cokey
WHERE cm.flodfreqcl IN ('Occasional', 'Very Frequent', 'Frequent', 'Rare', 'Very rare', 'Common') AND l.areasymbol =
'US'
GROUP BY m.mukey, m.musym, m.muname, m.muacres, c.compname, c.comppct_r, cm.flodfreqcl
ORDER BY m.muname, c.compname, c.comppct_r DESC