I usually can figure out any sql queries I need for my applications, but I have recently been stumped by a Cross Tab query I need to create and was wondering if you could he
I think your missing a table that make a reference between your site and equipment
Something like that :
EquipmentSite(SiteID, EquipID)
Because now it's impossible to tell wich site as wich equipment
EDIT :
Since the siteID is also in equipment I would propose another table, a little refactor of you database (because I really don't know how to do this)
If you get a lot of data it would be a mess to fetch the data and calculate every thing every time you want to access those data.
So I propose this table
siteCatCount(CatID, siteID, cnt)
So when you modify you data (add or remove equipment) you would go update this table, it would be much clearer and you wont have to calculate the count of every equipment each time