Multiple choice technology databases

A column with varchar datatype is populated with number values. What is the possible output with the default ORDER BY clause?

  1. 1 11 111 2 3 4

  2. 1 2 3 4 11 111

  3. 111 11 4 3 2 1

  4. ERROR due to data type mismatch

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

VARCHAR columns store character data, so ORDER BY uses lexicographic (dictionary) sorting, not numeric. String '11' comes before '2' because '1' < '2'. The sorted order is: 1, 11, 111, 2, 3, 4.