Importing to SQLite
With the Terminal (Mac & Linux)
Press
CTRL+ALT+T
to open a new terminal window.Download the
us-cities.zip
file using the unique download link we emailed to you after purchase. You can do this with thewget
command:$ wget -O us-cities.zip https://www.uscitieslist.org/download/xxxx-xxxx/
Once the download has finished decompress the
us-cities.zip
file. You can do this with theunzip
command:$ unzip us-cities.zip
Use the
sqlite3
command to open (or create a new) SQLite database. For example to open theexample.db
database in your current directort use the command:$ sqlite3 example.db
Once connected to the SQLite database use the
.read
command to run the import script you extracted in step 3.sqlite> .read us-cities/sql/us-cities.sql
After the import is complete you can query the data. For example type the following query and hit enter:
sqlite> SELECT * FROM us_cities LIMIT 10;