The document proposes an automated approach for ranking tuples in the results of SQL queries over databases. It computes global and conditional scores for tuples based on attribute correlations learned from past query workloads and data statistics. At query time, it merges pre-computed ranked lists corresponding to the query attributes to efficiently retrieve the top-k results without a full table scan. Experiments on real datasets show the approach is efficient and provides high quality rankings preferred by users over alternative methods.