Ever needed to locate every page (tab in DNN old speak) where a module is used? This is often needed when updating a site and want to confirm that each use of the module converted properly.
So use this query:
SELECT t.taborder,
t.tabid,
t2.tabname AS [Parent Tabname],
t.tabname,
m.moduleid,
m.moduletitle
FROM dbo.tabs t
JOIN tabmodules tm
ON t.tabid = tm.tabid
JOIN dbo.modules m
ON tm.moduleid = m.moduleid
JOIN dbo.moduledefinitions md
ON m.moduledefid = md.moduledefid
JOIN dbo.desktopmodules dm
ON md.desktopmoduleid = dm.desktopmoduleid
LEFT OUTER JOIN tabs t2
ON t.parentid = t2.tabid
WHERE dm.friendlyname = "TMinus"
AND t.portalid = 2
AND m.isdeleted = 0
AND dm.isadmin = 0
ORDER BY t.taborder
As you can see I have explicitly defined the friendlyname of the module -- in this case "TMinus"
This query return the parent and page where the module exists -- in this case I have one on the Home Page and 4 examples under the Free Modules>T-Minus V3.1 page

NOTE: Prior to V3 of DNN, Pages were referred to as Tabs -- the change in terminology never made it to the database -- rather huge job to convert the names. So where you see Tab -- think page.
Hope this helps
Paul.