It will not be unusual that, as you learn more or become highly productive,
you would be dealing with various databases, some of which you will create, some others will have been created by someone else. In all cases,
whenever you are performing a database task on an existing database, you should
make sure you know what database you are currently using.
In SQL, to indicate the name of the database you want to
work on, type the following formula:
USE DatabaseName;
The USE keyword is required. The DatabaseName factor
is the name of the database you want to open. You must provide the exact name of
the database. If you don't remember the name of the database you want to use,
you can open Windows Explorer or My Computer and display the contents of the Drive:\Program Files\MySQL\MySQL Server
4.1\data folder for a MySQL database or the Drive:\Program Files\Microsoft SQL
Server\MSSQL\Data folder for an MSDE database.
If using MSDE or MS SQL Server, the shortcut to know the names of the
databases stored in your computer is to execute sp_databases (sp_databases
is a stored procedure).
If using MySQL, to get a list of the databases, you can
execute the SHOW DATABASES; statement. |