Saturday, July 23, 2011

USE


The USE keyword is used to select a database in MySQL. The syntax is as follows:
USE "Database Name"
For example, if you want to connect to a database called "Scores", you can type in the following:
USE Scores;
In MySQL, you can access tables in multiple databases by specifying [Database Name].[Table Name]. If the table you want to access is currently in the database you use, there is no need to specify the database name.
For example, if you want to access table "Course_110" from database "Scores" and table "Students" from database "Personnel", you can type in the following:
USE Scores;
SELECT ...
FROM Course_110, Personnel.Students
WHERE ...
;

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Deep's | Bloggerized by Deep - Deep's Templates | ElearSQL-Server