Open your command line utility (Terminal on the Mac).
Use a few UNIX commands to get your whereabouts:
pwd (print working directory) to see your directory location.
ls (list) to view which files are in that directory.
cd (change directory) followed by the desired directory's path.
Once you've navigated to the directory where your data lives, start the SQLite program by typing
The system will immediately list basic details about the program you've entered
SQLite version 18.104.22.168 2015-05-20 18:17:19
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
Following these details you will see the command line prompt has changed to sqlite>. This means you can now enter SQL statements and see results. End each statement with a semicolon and press return to execute.
Optionally, when you first type
sqlite3 to launch the program, you can also type the name of the database file on the same line and then press return to enter that database right away.
If the database file does not exist, SQLite will automatically create a new one with the given name as a temporary file. SQLite will delete the file once you exit sqlite3).
Enter .help for usage hints.
Press ctrl-D to terminate the sqlite3 program.
Press ctrl-C to stop a long-running SQL statement.
Here's how to log in to SQLite and immediately create a new database named directory in the same command, followed by the creation of a table named "employees" with fields for name and hats:
sqlite> create table employees(name varchar(10), hats smallint);
sqlite> insert into employees values('Dan',3);
sqlite> insert into employees values('Jan',4);
Then query your new data right away by using the SELECT command:
sqlite> SELECT * from employees;
Import data from a csv