Get Magento 2 Category Tree in MySQL by Store

Quick lill’ snippet to fetch the Category Tree of your Store by a given Store name, in MySQL.

SELECT 
    catentity.*
FROM
    dbprefix.catalog_category_entity catentity
WHERE
    catentity.path LIKE CONCAT('1/',
            (SELECT 
                    root_category_id
                FROM
                    dbprefix.store_group sites
                WHERE
                    name = 'Your Store Name'),
            '/%')