degree cardinality sql