I have category and subcategory tables.

My subcategory table contains `cat_id` column.

Now I want to displaying all sub categories with their category id and category name in one html table.

How can I achieve it in a single query?