Discussing the article: "Market Simulation (Part 19): First Steps in SQL (II)"

 

Check out the new article: Market Simulation (Part 19): First Steps in SQL (II).

As we explained in the first article about SQL, there is no point in spending time programming procedures to do what is already built into SQL. However, without knowing the basics, you won’t be able to do anything with SQL or take full advantage of everything this tool offers. Therefore, in this article, we will look at how to perform basic tasks in databases.

So, now it’s time to experiment. We’re just starting to learn, so the «side effects» will be minimal. However, I want to warn you that you should never execute any SQL commands on an important database without first understanding what they do. If you’re going to try something new, do it as safely as possible to avoid trouble later. As the saying goes, «faith can move mountains, but it won’t restore your data».

Now let’s take a look at this «magic» command. In the animation below, you can see what it’s about.

Notice: the DROP command, when used in SQL, allows us to permanently delete something. If we use this command without proper care, we can run into serious problems. Be aware that SQL will not ask for any confirmation—it will simply delete whatever we specify.

However, when using MetaEditor, the database file itself will not be deleted. But if we send the same command that caused an error in the animation for SQL execution, our database file will indeed be deleted.

However, one might mistakenly assume that MetaEditor refuses to execute the DROP command. But as you could see in the animation, that is not the case, since it was possible to delete a previously created table.


Author: Daniel Jose