Selecting a Database
As you’ve just seen, when you first connect to SQL Server, a default database is opened for you. This is usually a database named master (which as a rule you should never play with). Before you perform any database operations, you need to select the appropriate database. You did this using the drop-down box in the toolbar, but you can also select the database using the SQL USE keyword.
For example, to use the learnsql database, you would enter the following (in a query window) and execute it:
Input
USE learnsql;
Output
Command(s) completed successfully.
Analysis
The USE statement does not return any results, but you will see a message confirming that the command was successfully completed.
Remember, you must always USE a database before you can access any data in it.