Definiaion of Queries in MSD Axapta

Queries in the AOT are predefined static queries that can be reused throughout the whole application. A query contains a hierarchy of data sources that defines the data that should be available for the query. Queries can also be used by other elements in AX such as in forms, reports, and classes.

You can add any numbers of tables to query.For example salesTable and SalesLine table relation is salesid field you can create query using salesid field.

Query can be used with reports. You can add query in datasources.