I am new to SQLite3.
I am trying to create a DB in the shell. When I run the shell, it already shows:
SQLite version 3..
Enter “.help” for instructions ..
Enter SQL…
Enter SQL statements terminated with a “;”
I read somewhere that I should be able to type “$” and codes like “$ sqlite3 mynotes.db”
Now, I need to be able to name my DB (like “mynotes.db”) and be able to decide in which folder I want it to be saved.
Can someone help me? Cheers!
The
$somewhere was supposed to be a prompt of some shell (command processor), where you startsqlite3and specify database name (which is created if does not exists).If you’re running
sqlite3without a shell (by clicking onsqlite3.exe?), it’s time to try another way.CMD.EXEon Windows is as good for this job as a typical Unix shell.As of the folder where the database will be: either
cdto this folder before you runsqlite3 mynotes.db, or specify full pathname to the database:sqlite3 "C:\Users\Me\Documents and Settings\mynotes.db"(double quotes are needed when argument contains spaces).When
sqlite3is started with no parameters, the database will be in memory. Sqlite3 supports “attaching” other databases (see ATTACH DATABASE description). This way, you can create and open on-disks databases even if startingsqlite3with parameters is impossible for some reason (or too hard).