自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

PHP中常用到的一些MySQL語句

數(shù)據(jù)庫 MySQL
下文將為您詳細介紹一些最為常見、常用的PHP中使用的MySQL語句供您參考學習,如果您對此方面感興趣的話,不妨一看。

在PHP開發(fā)中,經常會使用到MySQL語句,下面就為您列舉了一些經常使用的MySQL語句,希望對您平時的學習和開發(fā)工作能起到些許的作用。

MySQL語句顯示數(shù)據(jù)庫或表:
show databases;//然后可以use database_name;
show tables;

MySQL語句更改表名:
alter table table_name rename new_t;

MySQL語句添加列 :
alter table table_name add column c_n column attributes;

MySQL語句刪除列:
alter table table_name drop column c_n;

MySQL語句創(chuàng)建索引:
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);

MySQL語句刪除索引:
alter table c_table drop index c_n1;

MySQL語句更改列信息:
alter  table t_table change c_1 c_1 varchar(200);
alter table t_table modify 1 c_1 varchar(200);

insert插入語句:
insert into table_name (c_1,c_2)
values ('x1',1);

update語句:
update  table_name set c_1 =1 where c_2=3;

MySQL語句刪除數(shù)據(jù)庫或者表:
drop table table_name;
drop database database_name;//使用mysql_drop_db()可以刪除的.
 

 

 

【編輯推薦】

mysql UPDATE語句的使用方法

mysql中case when語句的使用示例

Mysql更新字段中部分數(shù)據(jù)的方法

mysql插入Clob字段的實例

mysql中int數(shù)據(jù)類型長度的問題

責任編輯:段燃 來源: 互聯(lián)網(wǎng)
相關推薦

2010-09-28 14:14:19

SQL語句

2022-03-22 07:38:00

SQL語句MySQL

2014-05-13 09:55:13

iOS開發(fā)工具

2021-08-28 11:47:52

json解析

2011-07-10 00:02:39

PHP

2024-01-30 10:11:00

SpringBoot項目開發(fā)

2011-10-11 17:10:35

MySQL

2011-03-15 17:46:43

2019-08-19 14:56:07

設計模式javascript

2018-05-10 16:02:48

Android程序贈工具

2009-11-26 10:32:57

PHP代碼優(yōu)化

2012-06-14 13:20:44

MySQL網(wǎng)站架構

2022-02-17 13:58:38

Linux技巧文件

2025-01-15 09:00:20

2009-11-25 09:23:47

PHP引用&符號

2019-08-07 16:50:38

SQLjoingroup

2012-03-14 14:30:13

Ubuntu軟件包

2021-12-20 10:55:05

Git命令Linux

2020-10-19 19:25:32

Python爬蟲代碼

2011-11-28 15:57:26

MySQL數(shù)據(jù)庫主從配置
點贊
收藏

51CTO技術棧公眾號