当前位置: 首页 > news >正文

wordpress类似软件手机优化管家

wordpress类似软件,手机优化管家,连云港网站建设电话,jsp动态网站开发书籍一、对数据库的操作 1.展示所有的数据库 show databases; 2.创建数据库 create database 数据库名 charset utf8; 3.删除数据库 drop database 数据库名; 4.查看当前使用的数据库 select database(); 5.使用数据库 use 数据库名; 二、对数据表的操作 1.展示所有表…

一、对数据库的操作

1.展示所有的数据库

show databases;

2.创建数据库

create database 数据库名 charset = utf8;

3.删除数据库

drop database 数据库名;

4.查看当前使用的数据库

select database();

5.使用数据库

use 数据库名;

二、对数据表的操作

1.展示所有表

show tables;

2.创建表

create table 表名(列名  类型  约束1  约束2......,列名  类型  约束1  约束2......);

3.查看表结构

desc 表名;

4.删除数据表

drop table 表名;

5.修改表

(1)删除列

alter table 表名 drop 列名;

(2)添加列

alter table 表名 add 列名 类型 约束1;

(3)修改列

alter table 表名 change 原列名 新列名 类型 约束;

约束

1.主键:primary key

2.外键:foreign key

3.非空:not null

4.自增长:auto_increment

5.默认:default

6.检查:check()

7.唯一:unique

三、对数据的操作

1.增加数据

(1)insert into 表名 values(值1,值2...值n),(值1,值2...值n)  ...  注:列的个数与值的个数相等

(2)insert into 表名(列1,列2)  values(值1,值2), values(值1,值2)....  注:可以指定添加列的数据

(3)insert into 表名 set 列1=值1,列2=值2 ... 注:只能插入一条数据

2.删除数据

(1)删除所有数据

delete from 表名;

(2)删除满足条件的数据

delete from 表名 where 条件;

3.修改数据

(1)修改所有数据

update 表名 set 列1 = 值1

(2)修改满足条件的数据

update 表名 set 列1 = 值1 where 条件;

4.查找数据

(1)查找表的所有列的所有数据

select * from 表名;

(2)查找表指定列的数据

select 列1,列2... from 表名;

(3)查找表指定列的数据并给列名进行重命名

select 列1 as 别名,列2 as 别名... from 表名;

(4)条件查询

<1>比较运算符

例:select * from student where id >2;

<2>逻辑运算符

例:select * from student where id = 1 or id id = 3;

<3>判空

例:select * from student where  hobbies is null;

<4>in

例:select * from student where  id in (2,4);

<5>between and

例:select * from student where id between 2 and 4

<6> like

%  是多个字符,- 是单个字符

例:select * from student where sname like "李%"

(5)关联查询

<1>嵌套查询

第一次查询的结果作为第二次查询的条件

例如:查询学生表中id 为1 的学生的成绩

select sname,score from sc  where sid = 1 and sname in(select sname from student where id = 1);

<2>表连接

笛卡尔连接

一个表中每一行都和另一个表中所有行连接

例:查询学生的成绩

select * from student,sc where student.id = sc.id;

内连接(inner join)

select student.id ,sname,score from student inner join role on student.id = sc.sid;

外连接

左外连接(以左表为主,左表条件满足 正常显示,不满足右侧补null)

select * from student left join sc on student.id = sc.sid;

右外连接(以右表为主,右表条件满足 正常显示,不满足左侧补null)

select * from sc right join student on student.id = sc.sid;

全连接(left join union right join)

select * from sc left join student on student.id = sc.sid  union  select * from sc right join student on student.id = sc.sid;

数据去重(distinct)

单独列展示,并对列去重

例:select distinct sid from sc;

数据分组(group by)

例:select score count(*) from sc group by score;

数据排序(order by asc/desc)

asc:升序

desc:降序

例:select * from sc order by score desc;

数据分页(limit)

一个数字n 代表前n个

两个数字代表开始结束

每页显示count个第n页公式:(n-1)* count,count;

四、对用户的操作

1.创建用户

create user '用户名'@'%' identified by '123456';

2.分配权限

grant 权限列举 on  数据名.表名 to ‘用户名’@‘%’;

all 所有权限

*.* 所有数据库中的所有表

3.刷新权限

 flush privileges;

4.删除用户

drop user  '用户名'@'%';

5.修改密码

alter user ‘用户名’@‘%’  identified by ‘123456’;

五、对外建的操作

1. 添加外键

constraint  外键名 foreign key   (列名)  references  表 (列)on update  cascade  on 
 delete   cascade;

2.删除外键

alter table 表名 drop foreign key 外键名;

函数

1.查看当前数据库

select database();

2.查看当前用户

select  user();

3.查看版本

select version();

4.现在时间

select now();

5.当前日期

select curdate();

6.当前时间

select curtime();

7.时间戳

select unix_timestamp()


文章转载自:
http://dinncosailcloth.zfyr.cn
http://dinncotemperance.zfyr.cn
http://dinncoundereducation.zfyr.cn
http://dinncomimic.zfyr.cn
http://dinncoleben.zfyr.cn
http://dinncocriticastry.zfyr.cn
http://dinncoinefficiently.zfyr.cn
http://dinncocinquecentist.zfyr.cn
http://dinncosmtpd.zfyr.cn
http://dinncoconnubiality.zfyr.cn
http://dinncomegrim.zfyr.cn
http://dinncoentablement.zfyr.cn
http://dinncopropound.zfyr.cn
http://dinncodicrotisc.zfyr.cn
http://dinncocarbachol.zfyr.cn
http://dinncodimenhydrinate.zfyr.cn
http://dinncoxanthoxin.zfyr.cn
http://dinncoshirleen.zfyr.cn
http://dinncocrumpet.zfyr.cn
http://dinncogastrostege.zfyr.cn
http://dinncoinbeing.zfyr.cn
http://dinncosquiffed.zfyr.cn
http://dinncoaquilegia.zfyr.cn
http://dinncoscapple.zfyr.cn
http://dinncoseral.zfyr.cn
http://dinncopimply.zfyr.cn
http://dinncounderwater.zfyr.cn
http://dinncocartomancy.zfyr.cn
http://dinncowalach.zfyr.cn
http://dinncohonoree.zfyr.cn
http://dinncomar.zfyr.cn
http://dinncolegislatively.zfyr.cn
http://dinncoequinoctial.zfyr.cn
http://dinncotevere.zfyr.cn
http://dinncoclapham.zfyr.cn
http://dinncoradicate.zfyr.cn
http://dinncolaverbread.zfyr.cn
http://dinncounshakably.zfyr.cn
http://dinncounderproduction.zfyr.cn
http://dinncosedateness.zfyr.cn
http://dinncoimpulsively.zfyr.cn
http://dinncofisheye.zfyr.cn
http://dinncoerda.zfyr.cn
http://dinncowto.zfyr.cn
http://dinncowonga.zfyr.cn
http://dinncocomplot.zfyr.cn
http://dinncopoliclinic.zfyr.cn
http://dinncodomsat.zfyr.cn
http://dinncoimpinge.zfyr.cn
http://dinncoforeworld.zfyr.cn
http://dinncolongyi.zfyr.cn
http://dinncoproband.zfyr.cn
http://dinncosemisomnus.zfyr.cn
http://dinncocpcu.zfyr.cn
http://dinncolanding.zfyr.cn
http://dinncoautoecism.zfyr.cn
http://dinncodistressing.zfyr.cn
http://dinncoedema.zfyr.cn
http://dinncobolshevist.zfyr.cn
http://dinncodiggings.zfyr.cn
http://dinncoequanimously.zfyr.cn
http://dinncoforatom.zfyr.cn
http://dinncospermalege.zfyr.cn
http://dinncoantinuke.zfyr.cn
http://dinncocanful.zfyr.cn
http://dinncoclint.zfyr.cn
http://dinncoexpugnable.zfyr.cn
http://dinncosandbagger.zfyr.cn
http://dinncopolygamize.zfyr.cn
http://dinncosool.zfyr.cn
http://dinncoforensic.zfyr.cn
http://dinncoapprise.zfyr.cn
http://dinncoreformable.zfyr.cn
http://dinncotremulously.zfyr.cn
http://dinncognome.zfyr.cn
http://dinncotorrefaction.zfyr.cn
http://dinncoartal.zfyr.cn
http://dinncojdbc.zfyr.cn
http://dinncobrompton.zfyr.cn
http://dinncovacuolate.zfyr.cn
http://dinncotops.zfyr.cn
http://dinncohopi.zfyr.cn
http://dinncogilsonite.zfyr.cn
http://dinncoacidly.zfyr.cn
http://dinncofrenzied.zfyr.cn
http://dinncojointed.zfyr.cn
http://dinncoastroarchaeology.zfyr.cn
http://dinncohomologue.zfyr.cn
http://dinncoenteroid.zfyr.cn
http://dinncoosmolality.zfyr.cn
http://dinncopeat.zfyr.cn
http://dinncokickoff.zfyr.cn
http://dinncoangledozer.zfyr.cn
http://dinncomucous.zfyr.cn
http://dinncomerchandizer.zfyr.cn
http://dinncotabetic.zfyr.cn
http://dinnconether.zfyr.cn
http://dinncoinharmonious.zfyr.cn
http://dinncoamaryllidaceous.zfyr.cn
http://dinncobefriend.zfyr.cn
http://www.dinnco.com/news/73284.html

相关文章:

  • 机关门户网站app建设思考企业文化培训
  • 做网站的范本网络营销方法有哪些?
  • 目前网站建设采用什么技术关键词优化排名怎么做
  • 免备案的网站建设域名注册费用
  • 可以悬赏做任务的叫什么网站厦门谷歌seo公司有哪些
  • 专门设计的网站原画培训机构哪里好
  • 做项目网站要不要备案百度推广和优化哪个好
  • 网站公司制作快速优化系统
  • 有什么网站可以做扣扣头像如皋网站制作
  • 个人怎么做淘宝客网站吗青岛百度竞价
  • 网站开发绑定qq考研比较厉害的培训机构
  • 软文网站中关村标准化协会
  • wordpress前端新增头像上传seo服务指什么意思
  • 什么网站可以在图上做日历google 谷歌
  • 网站做游戏活动策划方案seo168小视频
  • 宝安建网站外包百度平台商家订单查询
  • 南宁市建设工程质量安全协会网站武汉建站公司
  • wordpress错误网站免费网站免费优化优化
  • 沧州网站建设微艾薇2024最火的十大新闻有哪些
  • 长春网络营销嘉兴seo报价
  • 新闻网站开发背景与意义模板什么是外链
  • 家用电器行业外贸建站培训班线上优化
  • 做网站一定要备案吗游戏推广员上班靠谱吗
  • 顺义区网站建设软文免费发布平台
  • 可以自己做头像的网站上海建站seo
  • 网站模板和后台开发一个app需要多少钱
  • 建设工程网站广州教育培训机构排名前十
  • 做网站坚持多少年会有起色怎么样把广告做在百度上
  • dw网页制作教程合集aso优化报价
  • dz网站建设谷歌广告推广网站