Example implementations relate to automatic generation of sub-queries. For example, a computing device may include a processor. The processor may receive a query defining a particular set of data stored in at least one database. The processor may access metadata associated with the particular set of data and may select a data attribute associated with the particular set of data based on the metadata. The processor may automatically generate sub-queries of the query using the data attribute selected based on the metadata. The processor may process the sub-queries and provide a query result of the query that is a combination of sub-query results of the sub-queries.