How has the Supreme Court used different levels of judicial scrutiny for racial, ethnic, and gender classifications?

The Court has developed three levels of judicial scrutiny (or classifications).
1. Most classifications that are reasonable (that bear a rational relationship to some legitimate governmental purpose) are constitutional.
2. Racial and ethnic classifications are inherently suspect: they arepresumed to be invalid and are upheld only if they serve a "compelling public interest" that cannot be accomplished in some other way.
c. Classifications based on gender fit somewhere between
reasonable and inherently suspect: gender classifications must bear a substantial relationship to an important legislative purpose (and is sometimes called "medium scrutiny").