Sorting intelligence. An important part of query a database is to control how the output list is to be ordered. The system provide a visual intelligent user interface using which any combination of sorting options can be performed. There are also simplified mode and complete mode to use. A subset of all sorting operations can be performed in the simplified mode using controls on selected column header.