I use Command Line Shell For SQLite on Windows within Git Bash console.
Let there be products.csv file in the working directory
name,price
"product A",125.00
"product B",8.99
"product C",20.50
"product D",109.99
I do import to a new products table
sqlite> .mode csv
sqlite> .import products.csv products
I check table schema. The price column is TEXT
sqlite> .schema products
CREATE TABLE products(
"name" TEXT,
"price" TEXT
);
As the result ordering records by price is alphabetical
sqlite> SELECT * FROM products ORDER BY price;
"product D",109.99
"product A",125.00
"product C",20.50
"product B",8.99
How to change the price column type to float in SQLite3?
P.S. The following solution does not work for me (I tried REAL, NUMERIC and FLOAT).
sqlite> UPDATE products SET price = CAST(price AS REAL);
sqlite> .schema products
CREATE TABLE products(
"name" TEXT,
"price" TEXT
);