六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

MySQL常用語法

[摘要]顯示有哪些數據庫:show databases;創建數據庫:create database database1;刪除數據庫:drop database database1;使用數據庫:use dat...
顯示有哪些數據庫:show databases;

創建數據庫:create database database1;

刪除數據庫:drop database database1;

使用數據庫:use database1;

查看表:show tables;

新建表:create table table1(

id int(10) not null primary key auto increment ,

a varchar(20),

b int(10),

c varchar(10) default '男',

d int(10)

);

查看表結構:desc student;

刪除表:drop table student;

刪除主鍵:alter table table1 drop primary key;

增加主鍵:alter table table1 add primary key(id);

刪除字段:alter table table1 drop classid;

增加字段:alter table table1 add classid int(10);

增加記錄:insert into table1(a,b,c,d) values('哈哈',1,'你好',2);

刪除:delete from table1 where b = 1;

修改:update table1 set a = '哈哈哈' where b=1;

通配符 %:多個任意的字符 _:一個字符

update table1 set b = 2 where name like '%i%';

查詢:

select * from table1;

select id,name from table1;

select * from table1 where b like '%i%';

排序 默認升序asc 降序desc

select * from table1 order by a asc;

select * from table1 order by a desc;

select * from table1 order by a desc,b asc;

組函數 min max count avg

select count(*) from table1;

select min(a) from table1;

select avg(a) from table1;

select max(a) from table1;

分組:select classid,avg(b) from table1 group by classid having avg(b)>5;

字句作為查詢的條件:select * from table1 where age = (select min(b) from table1);

以上就是MySQL常用語法的詳細內容,更多請關注php中文網其它相關文章!


學習教程快速掌握從入門到精通的SQL知識。




主站蜘蛛池模板: 亚洲欧美日韩中文不卡 | 一级黄色a级片 | 午夜综合网 | 午夜欧美精品 | 四虎免费大片aⅴ入口 | 天天干天天干天天 | 日韩有色 | 欧美在线视频你懂的 | 亚洲美女爱爱 | 欧美亚洲人成网站在线观看刚交 | 一级片久久| 我在修仙世界朝九晚五漫画免费观看 | 五月婷六月婷婷 | 日韩亚洲欧美一区二区三区 | 日本一本在线播放 | 色天使久久 | 亚洲欧美日韩在线精品一区二区 | 色我网站| 日本视频网站在线观看 | 日韩久久免费视频 | 天堂网站天堂小说 | 亚洲国产99在线精品一区69堂 | 日韩三级免费观看 | 午夜影院普通用户体验区 | 亚洲一欧洲中文字幕在线 | 四虎永久免费地址在线观看 | 日韩一区精品 | 中文字幕在线视频精品 | 日韩欧美视频在线播放 | 亚洲伊人久久大香线焦 | 影音先锋色69成人资源 | 色天使色护士 在线视频观看 | 日韩禁片 | 先锋影音在线资源站大全 | 一级做性色a爰片久久毛片免费 | 亚洲精品福利在线观看 | 日韩高清专区 | 四虎www成人影院免费观看 | 亚洲伊人久久大香线蕉啊 | 亚洲第一区精品日韩在线播放 | 亚洲成a人片在线看 |