Get devices with not driver assigned
In SQL Server, I would write the following query:

SELECT *
FROM dbo.driver d
    LEFT JOIN dbo.driver_has_device dhd ON d.id = dhd.driver_id
WHERE dhd.driver_id IS NULL;


Essentially, this returns all rows from drivers that do not have a corresponding row in driver_has_device.