FuzzDuck
FuzzDuck
Use database
FuzzDuck
Use database

Use database

With an ever-growing server, there may be more than one database. To make sure, that you are giving the right commands, to the right database you tell the RDBMS that you want to point the commands at that specific database through the USE DATABASE command. The RDBMS will then know that the following commands are meant for that specific database. For example, when you call the create table command, the RDBMS will know in which database the table will be put.

--- SQL command to indicate which database the next commands should be used against ---
USE databasename;

DuckTown

Image if we have three databases called DuckTown, DogCity and CatVille. We need to create table inside the DuckTown database and want to make sure that the RDBMS knows which database the command is pointing at. Here we enter USE DuckTown; to tell the RDBMS that the following commands are directed at that database. All the following commands will be directed at the DuckTown database until we tell the RDBMS to use another database. For instance, we can call the USE DogCity command;. The following command will then be directed at the DogCity database, and the DuckTown database will not be affected.

--- SQL command to indicate that the next SQL commands are used towards DuckTown ---
USE DuckTown;