Basic Tutorials | tutorials | statement |MYSQL
Downloads provide some MySQL statements that are often used in php+mysql development and are available to beginners for reference and collection.
Are some of the most commonly used and useful sentences.
MySQL display database or table:
The following are the referenced contents: Show databases;//can then use database_name; Show tables; |
MYSQL Change table name:
ALTER TABLE table_name rename new_t; |
MYSQL Add columns:
ALTER TABLE table_name ADD column c_n column attributes; |
MYSQL Delete column:
ALTER TABLE table_name DROP column c_n; |
MYSQL CREATE INDEX:
ALTER TABLE c_table Add index (C_N1,C_N2); ALTER TABLE c_table add unique index_name (c_n); ALTER TABLE c_table add primary key (SID); Webjx.com
|
MYSQL Delete index:
ALTER TABLE c_table DROP INDEX c_n1; |
MYSQL Change column information:
ALTER TABLE t_table change c_1 c_1 varchar (200); ALTER TABLE t_table Modify 1 c_1 varchar (MB); |
Insert Insertion Statement:
INSERT INTO table_name (c_1,c_2) VALUES (' x1 ', 1); |
UPDATE statement:
UPDATE table_name set c_1 =1 where c_2=3; |
MYSQL Delete database or table:
DROP TABLE table_name; Drop database database_name;//using mysql_drop_db () can be deleted. |