Can't get sqlite3 command to work in Git Bash

I already re-downloaded both, and I tried running git bash in visual studio code, as well as with the default settings.

I have a shortcut on my desktop to sqlite3.exe. Is there any benefit to using db browser instead of just launching sqlite3.exe directly?

I’m sorry to hear that you couldn’t get it working with Git Bash and I’m pretty puzzled as well. I’ve helped a lot of people troubleshoot this, but yours is the first where you’re typing the correct commands and having it freeze up. I’m assuming it works from double-clicking the .exe file?

The main benefit of having an alias for the .exe file is that you can open up the command line from anywhere and you can launch SQLite from there without having to navigate to the directory to find your database files. It is possible to create an alias in both Powershell and CMD as well, if that interests you, and it is built in if you use Anaconda or Miniconda.

As far as DB Browser goes, it has many advantages over the command line interface for SQLite. It is a much better way to explore data and it makes complex processes a lot easier in general. You can choose whether you want to write SQL or use point-and-click methods and even if you do end up using point-and-click, there is a window that shows you what the equivalent SQLite command would be.

The main drawback is that if you know the command line interface you will be a little more prepared for integrating SQLite into an app because you will know the commands you need to pass to the database. However, I tend to use the command line the least out of several different ways I interact with SQLite. This is primarily because data exploration is fairly uncomfortable on the command line.

Can I still do the exercises as described through the curriculum if I just access the sqlite3.exe directly, or does this add anything else I need to know? If I need to know additional stuff, where can I find that info?

Yes it works fine for the rest of the curriculum. Most of Codecademy projects are on-platform anyway unless you decide to take them off. The main thing to watch out for with clicking on the .exe directly is that you need to navigate to your database file manually through the SQLite interface using the .cd command (unless the file is in the same directory as the .exe). If you forget to do this and just use .open example.db SQLite will create a database called example.db if there isn’t an existing one in that directory. Sometimes you might want this, but it can be confusing for beginners who wonder why they have an empty database instead of their completed one that has the same name.

Without the needed context what you just wrote is jibberish.

A directory is a folder. A SQLite database file is usually saved with the file extension .db or .sqlite.

If you try to open the database file by using only its name (for example, example.db) SQLite will check if that database is in the current directory (folder). If that database is there, it will open it, but if it is not then it will create a new database with that name.

When you are able to set up SQLite the way the Codecademy instructions tell you to, this is easy to avoid because you navigate to the folder containing your database first (using the cd command in the terminal) and then use the command sqlite3 to open SQLite.

When you click the sqlite3.exe file directly, it will open SQLite in the folder where the .exe file is located. For example, if sqlite3.exe is on your desktop, thats where SQLite will open up.

Let’s say your file structure looks like this:

├── folder1
├── sqlite3.exe
├── Example
│   ├── Databases
|   |   |-- example.db

sqlite3.exe is in your Desktop folder and you double-click it to start the program.

Because you couldn’t navigate to the folder Databases before launching SQLite, you have to open your database file (example.db) by using the command .open Example/Databases/example.db or navigate there through SQLite using this command: .cd Example/Databases and then open it: .open example.db

If you were to try opening your database with just .open example.db from the get-go, SQLite would search for example.db on the Desktop (where your .exe file is) and when it doesn’t find it, a new database called example.db will be created there on the Desktop.

Another thing about the .cd command in SQLite is that it doesn’t handle paths with spaces very well.
Here is a screenshot showing how to open a database (located in Desktop/Sample Database) from a start point of the original downloaded SQLite file. The top left is by clicking the .exe file. Notice how you have to use two separate .cd commands when there is a space in the file path:

Hopefully this helps illustrate things a little better. If this still seems like gibberish, I would highly recommend using DB Browser instead of the command line.

Happy coding!