Lex sort is 0-9, A-Z, a-z (by ASCII char code)
'0'.charCodeAt(0)
// 48
'A'.charCodeAt(0)
// 65
'a'.charCodeAt(0)
// 97
Example:
'yH2UOqtaQrbcoJBEZKM0jRzGPId6vkAnF8g1STp3NiW5wsDfV7lYx4emX9LCuh'.split('').sort().join('');
// '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
The same is true for SQL.
Lex sort is 0-9, A-Z, a-z (by ASCII char code)
Example:
The same is true for SQL.