Getting orders with items that have a certain attribute set (Magento 1)

The following MySQL query returns all Magento orders that have at least one item with attribute set id 9.

Getting the attribute set name of a product (Magento 1)

Use the following code to get a products attribute set name.