When you apply QUERY and IMPORTRANGE together, you can query a data range in another spreadsheet (or multiple spreadsheets).
SYNTAX: =QUERY(IMPORTRANGE("spreadsheet_url", "data_range"), "query_string")
spreadsheet_url – insert the URL of the spreadsheet to import data from.
data_range – insert a range of cells to query.
query_string – insert a string made using clauses of the Google API Query Language.
The below sheet is view only mode, please make a copy to practice.