A dataset is the definition of what you're looking for. It contains the criteria for filtering the data and the columns to return for records that match the criteria.
The query module is used to interact with data via scripting. The query module can run datasets that have been created. It can also create datasets on the fly.
Kind of a broad question but hopefully that helps.