SQLite Shell confusion

Screen Link: https://app.dataquest.io/m/192/table-relations-and-normalization/1/the-sqlite-shell

My issue is that I’m literally copying and pasting what is in the assignment but the shell is telling me that there is an error in my code. Since it’s code written by the assignment, this is impossible. What might be wrong?

I also do not understand why it seems that you cannot delete text you write in the command line shell. Is this normal? I can’t edit ANYTHING I write… HELP PLEASE!!!

1 Like

Thank you for editing @Sahil. Can you be a bit more helpful? I would like to continue using your program, but this makes it impossible.

1 Like

Hi @Willyjgolden,

Sorry for the confusion, the edit is done automatically whenever the student adds a screen link to their post. The purpose of the edit is to make it easier for students to find relevant topics for a specific mission or screen. For example:

https://community.dataquest.io/tag/192
https://community.dataquest.io/tag/192-1

#  sqlite3> .tables
#  sqlite3> .headers on
#  sqlite3> .mode column
#  sqlite3> SELECT
#      ...>   track_id,
#      ...>   name,
#      ...>   album_id
#      ...> FROM track
#      ...> WHERE album_id = 3;
#  sqlite3> .help
#  sqlite3> .shell clear
#  sqlite3> .quit

The solution code of this screen cannot be copy-pasted. This is because it contains # sqlite3> on each line. The # character is a workaround for our terminal screens to work the way we intended it to be and is not part of the actual solution and sqlite3> is a prompt you get automatically once you run
sqlite3 command.

So the solution code for this screen is designed for typing manually. In any case, if you wish to copy paste, then you can try this code:

sqlite3 chinook.db <<EOF
.tables
.headers on
.mode column
SELECT
   track_id,
   name,
   album_id
 FROM track
 WHERE album_id = 3;
.help
.shell clear
.quit
EOF

Heredoc (<<EOF) is not a concept we have taught in our command line missions. You can read more about it here:

Let me know if you have any further questions about it.

Best,
Sahil

The arrow keys aren’t working for me either and it makes it very cumbersome to edit stuff. Is this a function of the way this shell is produced by DQ or is this how SQLite operates in the real world?

5 Likes

I’m having similar issues - I’m unable to edit previously written commands and have to re-write them completely each time.

Once inside the sqlite shell, how do you call up the last command to edit it? up arrow doesn’t work, and if I use Ctrl C / Ctrl V to paste the previous command, then none of up/down/left/right arrows work.

Have you had any luck?

1 Like

I’m using windows and the shell is super slow for me for some reason.
My internet is screwed up today so i’m going through my phone hotspot so it might just be this reason.
having a few seconds of lag in input is extremely frustrating though so i’m doing everything by copy/paste.

I just write out the query in sublime or atom and then copy and then paste by right clicking the shell with my mouse and selecting paste plain text. If you do it this way, each line is fed in correctly.

I would probably just interact with sqlite this way, regardless.