Introduction
FORMAT helps show numbers nicely with commas and decimals. LPAD and RPAD add characters to the left or right of text to make it a certain length.
FORMAT(number, decimal_places) LPAD(string, length, pad_string) RPAD(string, length, pad_string)
SELECT FORMAT(1234567.891, 2);
SELECT LPAD('7', 3, '0');
SELECT RPAD('Hi', 5, '*');
SELECT FORMAT(9876543.21, 1) AS formatted_number, LPAD('42', 5, '0') AS left_padded, RPAD('Cat', 6, '!') AS right_padded;
FORMAT(12345.6789, 2) do?SELECT LPAD('abc', 6, '*'), RPAD('abc', 6, '!');SELECT LPAD('test', 4, '0');Pass the test and this pattern moves unknown