![]() If it does not exist, then the statement is simply ignored and nothing happens. The behavior it adds makes sure that the command only runs if the table exists. The IF EXISTS statement is optional when dropping a table. Adjusting the previous example will look like this to create the table in test: in your statement to create the table in a database other than main. If you have multiple connections open to databases, you need to specify. It is important to note that the CREATE TABLE statement will create the table you specify in the main database by default. In our example, the addition of PRIMARY KEY to the id field is an example of a table constraint. There is an exception if the constraint affects the interaction of multiple columns instead of a singular column.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |