ca_discovered_hardware:
This is all computers (discovered hardware). The dis_hw_uuid (discovered hardware UUID) is the primary key.
ca_server:
This is all scalability servers. The list includes the DM, since the DM is also a scalability server by design. Each record has a server_uuid, and there's a referential column (foreign key) for dis_hw_uuid, to match each server with it's discovered_hardware record in ca_discovered_hardware
ca_manager:
This is all ITCM managers, domain or enterprise. On a DM, there will be only one record there, for the DM itself. On an Enterprise, there will be one record for the Enterprise, plus additional records for each DM linked to the Enterprise.
ca_n_tier:
Dual purpose table. Firstly, it holds the database configuration (connection details) for the ITCM manager. Additionally if the DM is linked to an Enterprise, there will be a record in there for the Enterprise manager, so the DM can lookup it's database configuration for the purposes of replication. On an Enterprise, there will be one record for each DM as well, containing the database connection details for each manager. Including one record for the Enterprise itself. Also if you have a SQL bridge, there will be a record in the database with the connection details as well.
You can use this website (it's really old) as a guide:
Computer Associates International, Inc. Table List for MDB 1.4
Recommend you use the "Alphabetic" tab, and lookup by table name. Just realize this website is 10+ years old, and has not been updated. But still an excellent reference, nevertheless.
The query you reference:
select * from ca_discovered_hardware WHERE dis_hw_uuid IN (select dis_hw_uuid from ca_server where label not in (select label from ca_manager))
This returns the agent record for every scalability server, filtering out the domain manager from the list. So all scalability servers, minus the domain manager itself.