Below, given some Common SQL Command. Items bracketed [] are optional.
For a complete list of MySQL supported commands, visit the MySQL
website at http://www.mysql.com.
ALTER
ALTER TABLE table_name ADD [COLUMN] ...;
CREATE
CREATE DATABASE database_name;
CREATE TABLE table_name;
DELETE
DELETE FROM table_name [WHERE ...];
DROP
DROP DATABASE database_name;
DROP TABLE table_name;
GRANT
GRANT privilege ON table_name ►►
TO user [IDENTIFIED BY 'password'] [WITH GRANT OPTION];
INSERT
INSERT [INTO] table_name VALUES (...);
SELECT
SELECT ... [FROM table_name(s)] ►►
[WHERE ...] [GROUP BY ... ] [ORDER BY ...];
SET
SET PASSWORD FOR user@localhost = ►►
PASSWORD("password");
SET PASSWORD FOR user@"%.visibooks.com" = ►►
PASSWORD("password");
SET PASSWORD FOR user@"%" = PASSWORD("password");
SHOW
SHOW DATABASES;
SHOW TABLES;
UPDATE
UPDATE table_name SET column_name=value [WHERE ...];
USE
USE database_name;
Let’s study SQL ! Enjoy It !
Monday, July 28, 2008
Subscribe to:
Post Comments (Atom)
seja o primeiro a comentar!