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!