I'm searching for a way to query work items directly from the SQL database of TFS using SQL selects.
For TFS 2010, there were some database views you could use to achieve this goal. TFS2010: How to query Work Items using SQL on the Relational Warehouse
The example from the WIQ looks like this:
SELECT [System.Id], [System.WorkItemType], [System.Title], [System.AssignedTo], [System.State]
FROM WorkItems
WHERE [System.TeamProject] = @project
and [System.WorkItemType] = 'Ticket'
and [System.State] <> 'Closed'
and [System.State] <> 'Removed'