All right, so picking up where we left off, we have two databases successfully created, but read into the at least right now I only need one. So I want to remove one of these databases. So there is a command in SQL. So just remove this line, or I just come in to talk. So you can just use a double dash, right and then what this does is render this line useless. So if you're used to other languages, like maybe C sharp JavaScript, you know you have that double slash, or you have that slash and each language has its own way.
So in SQL, we actually just use a double dash. All right, I want you to see that line turning green. If you are using the default coloring scheme, then you will know that this line is not going to have any bearing on anything once you click Execute. So we can go to the next line, and we will want to delete or in this case, drop it in SQL nomenclature, drop or database, no, I want to warn you be very, very careful and deliberate when you are going to run this and execute this command. Because dropping a database is an irreversible, there's no Recycle Bin, there is no recovering method, or there are a few books at this stage. We're not ready for those.
So be very, very careful and very, very deliberate in writing and further executing this command, so we're going to say a drop database. And then as you go along, you start seeing that there's a pattern and I notice I'm not writing it in all caps. Once again, it is not case sensitive. So drop database, and then we have to specify the database name. So we want to drop school underscore test. So I'll just school underscore test and we see here that the editor is actually kind of picking up on the Once you may want to do, so it's kind of completing what it is that it thinks you want to do based on the information it has available to you.
So it makes it pretty easy to write complex statements in a very short while. So we want to drop the database called school underscore test. And then I'm going to execute that, once again, be very deliberate and careful when doing this, because SQL will not ask you if you're sure you want to delete this item. All right, SQL is just going to see that sorry, SQL Management Studio is just going to say this is the command I got I'm going to execute it. So when I click Execute, there we go. But we still see the database listed here.
So as usual, we just click here and refresh and then we see that there is no longer any trace of school underscore test. And if I attempt to execute this again, then I will get an arrow seen that I cannot drop it because it does not exist or you don't have friends. permission. We know we have permission, we know we just did it. So we know that it's because it does not exist in the same way. And a quick way to comment in SQL Management Studio is to press the Ctrl key and see, as a matter of fact, in the class notes, I have a bunch of keyboard shortcuts that can help you get along quickly and move along in the editor with with minimal effort.
All right, I love keyboard shortcuts. So we can say create database and I will try to create school. Well, we know we already have school so I just want to show you the type of error that you would see. And then it says database school already exists. Please choose a different name so we can't have two databases with the same name. If you need two identical named ones, you know you can use your underscore or you can add a number numbers are acceptable.
Of course the character sets there are strict rules are owned at budds We have infinitely many characters at our disposal. So we can always mix and match and be unique. Alright, so that was how we go about removing a database. Next we look at how we go about creating what we call tables in our database.