The present subject matter relates to a computer implemented method for stratified sampling of a database. The method includes receiving at least one stratification parameter indicating a type of data to be selected in the database. The method further includes obtaining a stopping parameter indicating a number of data records to be included in each of at least one stratum, creating the at least one stratum based on the at least one stratification parameter and the stopping parameter, and extracting data from the at least one stratum.