title: Return column name and distinct value in each column MySQL
body: <p>I have mutiple columns and I want to create a dynamic query which can return column name and each of their distinct values. I want to do this in MySQl</p>
  
  <p>So if I have only 2 columns:</p>
  
  <ol>
  <li>Gender which has Male and Female</li>
  <li>Purchase_Frequency with Low, Medium and High</li>
  </ol>
  
  <p>In that case the output should be</p>
  
  <pre><code>Entity                Unique_value
  gender                 Male
  gender                 Female
  Purchase_Frequency     Low
  Purchase_Frequency     Medium
  Purchase_Frequency     High
  </code></pre>
  
  <p>I found similar questions but didn't help me much</p>
  
  <p><a href="https://stackoverflow.com/questions/34319753/return-column-name-and-distinct-values">Return column name and distinct values</a></p>
  
  <p><a href="https://stackoverflow.com/questions/49256308/return-column-names-and-count-of-their-distinct-values-in-mysql">Return column names and count of their distinct values in MySQL</a></p>