Is any way to have the list of monitored devices that have for example more than x% loss during a specified period. Can this be done using sql queries?

Yes; if you're exporting packet loss to the database, then this can be done using either Reports or your own SQL. In Reports, you'll want to select all devices, choose the packet loss dataset, set the time range, then add a filter to show only those whose loss is greater than your value.

If you start with the 'device data' template, it should do all of that except for adding the filter.