How to list all categories and their IDs using SQL query?

I finally got the solution. Below SQL Query gets the list of all categories with it’s ID from WordPress table –

SELECT wp_term_taxonomy.term_id, wp_terms.name FROM wp_term_relationships 
LEFT JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) 
LEFT JOIN wp_terms ON (wp_terms.term_id = wp_term_taxonomy.term_taxonomy_id) 
WHERE wp_term_taxonomy.taxonomy = 'category' 
GROUP BY wp_term_taxonomy.term_id 
order by wp_terms.name

Hope this could help others.