SQL USE


  SQL > Table Manipulation > USE

The USE keyword is used to select a database in MySQL and SQL Server. 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 ...
;

SQL CREATE DATABASE >>

Link to this page: If you find this page useful, we encourage you to link to this page. Simply copy and paste the code below to your website, blog, or profile.



More 1Keydata Tutorials



Copyright © 2012   All Rights Reserved.         Privacy Policy  



SQL SELECT
SQL DISTINCT
SQL WHERE
SQL AND OR
SQL IN
SQL BETWEEN
SQL Wildcard
SQL LIKE
SQL ORDER BY
SQL Functions
SQL Average
SQL COUNT
SQL MAX
SQL MIN
SQL SUM
SQL GROUP BY
SQL HAVING
SQL ALIAS
SQL AS
SQL JOIN
SQL INNER JOIN
SQL OUTER JOIN
SQL LEFT OUTER JOIN
SQL CROSS JOIN
SQL SELECT UNIQUE
SQL ROUND
SQL CAST
SQL CONVERT
SQL CONCATENATE
SQL SUBSTRING
SQL INSTR
SQL TRIM
SQL LENGTH
SQL REPLACE
SQL DATEADD
SQL DATEDIFF
SQL DATEPART
SQL GETDATE
SQL SYSDATE

SQL CREATE TABLE
SQL CONSTRAINT
SQL NOT NULL
SQL DEFAULT
SQL UNIQUE
SQL CHECK
SQL PRIMARY KEY
SQL FOREIGN KEY
SQL View
SQL CREATE VIEW
SQL Index
SQL CREATE INDEX
SQL ALTER TABLE
SQL DROP TABLE
SQL TRUNCATE TABLE
SQL USE
SQL CREATE DATABASE
SQL DROP DATABASE
SQL INSERT INTO
SQL UPDATE
SQL DELETE FROM

SQL Jobs

Site Map
Resources