What type should be used for storing numbers in a database column to avoid leading spaces and ensure correct sorting?

When storing numbers in a database column, it is important to use a numeric data type such as INT or DECIMAL to avoid leading spaces and ensure correct sorting. Using a numeric data type will also help with calculations and comparisons involving these numbers.

// Example of creating a table with a column of type INT to store numbers
$sql = "CREATE TABLE numbers (
    id INT AUTO_INCREMENT PRIMARY KEY,
    value INT
)";
$conn->query($sql);