The SQLite command-line interface lets you create a database and load data for analysis. For a video-game dataset, run `sqlite3 games.db` in a terminal to create and open the database. section 5.2.1
Set up the data in three steps:
- Define a `games` table, listing each column and its type, such as `int` for numbers and `text` for text. section 5.2.1
- Set CSV mode and import the dataset from its file path into the `games` table. section 5.2.1
- Check the imported data by querying the number of rows with `SELECT count(*) FROM games;`. section 5.2.1
CREATE TABLE games( #1 rank int, name text, platform text, #2 year int, genre text, publisher text, americasales numeric, eusales numeric, japansales numeric, othersales numeric, globalsales numeric);
See the example table definition, including columns for game titles, platforms, genres, and sales. section 5.2.1
.mode csv #1 .import /Downloads/videogames.csv games #2
See the commands for switching to CSV mode and importing the file. section 5.2.1
