When does SQLite table reset itself? (I like to play)

I like to play around a bit as I learn SQL within my browser, so I often type additional statements into the code editor to see what will happen in the 3rd area (output). I realize that there are limitations to the way SQL is running in the web page, but I often get outputs which confuse me because they seem to have reset the database when I did not push the Reset button at the bottom of the web interface.

For example, after I ran the ALTER TABLE command taught, I ran an UPDATE-SET-WHERE set of clauses to add data into the new column, but since the table had already been “altered”, I removed the ALTER TABLE statement and just ran the UPDATE statement along with a SELECT statement to display the results. But the result was that the new column was gone.

So it seems to me that each set of instructions in the code editor starts over from a standardized database whenever we press RUN. Is this correct?

In summary, if we want to do a second set of things after pressing RUN, we should keep the existing statements that gave us the first modified state of the database and not delete them? Our database isn’t harmed by re-running those first-stage statements along with our new second-stage statements?

Thanks for an explanation!

No replies for six days. I’ve now figured out that, for a given page of coursework, we are to add statements to what’s already there, else we lose the values in our table. Each time you hit Run or Save, you’ll run the entire page of statements, and the results will be as expected. Removing statements you’ve already run once, but which created tables, or added or modified data, will mean that data doesn’t appear in your table.

This topic was automatically closed 18 hours after the last reply. New replies are no longer allowed.