Hands-on task
SQLite: import data from CSV
The file /root/data.csv contains a CSV with the header name,population and three rows of city data. Create a table cities(name TEXT, population INTEGER) in the database /root/geo.db and import the data from this CSV into it (the header row should not go into the table). In the end the table must contain exactly 3 rows with correct values.
You can look at the CSV in the Editor tab. Put the import script /root/import.sql together there too — CREATE TABLE plus sqlite3 dot commands — and run it.
- csv import
- dot-commands
- sqlite3
- .import
- create table