Quick Question for yall, so I set .nullvalue to "NULL" before writing my table updates. Second question, how do I rearrange columns in my final meteorites table that was it passes the CS50 Check50 and I am unsure why nametype is not included in the final table. This is what I posted on reddit asking for help... Thanks for the critiques! HI, I am having an issue with my table saying I don't have the correct columns, does anyone know what the final table columns need to be included and in a specific order different than that of the meteorites.csv import?
Below is the schema I created,
I am unsure if nametype is included in the final table, or where my error is coming from.
CREATE TABLE IF NOT EXISTS meteorites_temp ( name TEXT NOT NULL, id INTEGER, nametype TEXT NOT NULL, class TEXT NOT NULL, mass REAL, discovery TEXT, year YEAR, lat REAL, long REAL ); CREATE TABLE IF NOT EXISTS meteorites ( name TEXT NOT NULL, id INTEGER, nametype TEXT NOT NULL, class TEXT NOT NULL, mass REAL, discovery TEXT, year YEAR, lat REAL, long REAL, PRIMARY KEY (id) ); my cleaned meteorites_temp, has columns name, id, nametype, class, mass, discovery, year, lat, long
with the first row looking like,
Aachen, 1, Valid, L5, 21.0, Fell, 1880, 50.78, 6.08.
INSERT INTO meteorites_ordered (name, id, nametype, class, mass, discovery, year, lat, long)
SELECT (name, id, nametype, class, mass, discovery, year, lat, long)
FROM meteorites_temp
WHERE year = year ORDER BY name asc;