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

一个免费的影视网站模板一句吸引人的广告语

一个免费的影视网站模板,一句吸引人的广告语,怎么把做的网站发布,做ps彩图什么网站好1 数据库 1.1 新增 create database [if not exists] 数据库名; 1.2 删除 drop database [if exists] 数据库名; 1.3 查询 (1) 查看所有数据库 show databases; (2) 查看当前数据库下的所有表 show tables; 2 数据表 2.1 新增 (1) 创建表 create table [if not exists…

1 数据库

1.1 新增

create database [if not exists] 数据库名;

1.2 删除

drop database [if exists] 数据库名;

1.3 查询

 (1) 查看所有数据库

show databases;

(2) 查看当前数据库下的所有表

show tables;

2 数据表

2.1 新增

(1) 创建表

create table [if not exists] db_name.table_name (column_name data_type(size) comment '注释',...
) comment '表名';

  
(2) 复制表

-- 只复制表结构
create table 新表名 as
select * from 旧表名;-- 只复制表结构
create table 新表名 like 旧表名; -- 复制表结构及其数据
create table 新表名 as
select * from 旧表名;

(3) 生成临时表

表名 as (查询语句)

(4) 创建视图

create or replace view view_name as select statement

2.2 删除

(1) 删除表

drop table [if exists] 表名;

(2) 删除视图

drop view view_name;

2.3 修改

(1)  修改表名

-- rename:重命名,包括索引、表名
alter table 旧表名 rename to 新表名;

2.4 查询

(1) 查看表结构

desc 表名;show create table 表名;

3 数据

3.1 新增

(1) insert into ... values

-- 1 按指定列插入数据
insert into table_name 
(field1,field2...fieldn )
values (value1,value2,...valueN)
,(...)
;-- 2 所有列插入数据
insert into table_name
values (value1,value2,...valueN)
;

(2) insert into ... select

-- 1 从一个表中复制所有的列插入到另一个表中
insert into table2 
select * from table1; -- 2 从一个表中复制指定列插入到另一个表的指定列中
insert into table2 (column_name(s)) 
select column_name(s) from table1; 

3.2 删除

(1) 清空表

truncate table table_name;

​3.3 查询

(1) 条件查询

select-- as:为表名称或列名称指定别名,提高可读性列名1 as 列别名,列名2 as 列别名
from 表名 as 表别名
where 列名 运算符 列名/常量
[limit number]

(2) 去重查询

select distinct 字段名1,... from table1;

 (3) 分组查询

①group by

-- group by:根据一个或多个列对结果集进行分组,在分组的列上可以使用 count、sum、 avg等函数
select 列名,分组函数(列名)
from 表名
group by 列名
-- 分组后过滤
having 表达式
;

②group by ... grouping sets

-- grouping sets允许采用多种方式对结果分组,而不必使用多个select语句,从而提高执行性能.
-- grouping sets语法和普通group by类似,但需要额外执行所需的多个group by组合.例如以下sql的(列名1,列名2), ()),每个内层括号执行一个group by组合,空括号表示group by列表为空,即所有列
select 列名1,列名2,分组函数(列名) 
from 表名 
group by 列名1,列名2 
grouping sets((列名1,列名2),())
;

(4) 排序查询

-- 将查询数据排序后再返回数据,按字段值升序/降序,控制NULL值在排序后的结果中的位置.默认升序
select 列名 from 表名 order by 列名 [asc|desc] [nulls first|nulls last]

4 多表关联查询

4.1 多表关系

        ①一对一:将其中一方假设成多的一方,在多的一方添加外键指向一的一方的主键,并且给外键字段添加unique约束;

        ②一对多:在多的一方添加外键指向一的一方的主键;

        ③多对多:借助一张中间表,在中间表中至少有两个字段分别指向多对多双方的主键.

4.2 连接查询

(1) 内连接:获取两个表中字段匹配关系的记录

select表1.列名11,表1.列名12,...,表2.列名21,表2.列名22
from 表1
[inner] join 表2 on 表1.列名11 = 表2.列名21and 表1条件and 表2条件
;

(2) 左连接:获取左表所有记录,即使右表没有对应匹配的记录

select表1.列名11,表1.列名12,...,表2.列名21,表2.列名22
from 表1
left join 表2 on 表1.列名11 = 表2.列名21and 表2条件
where 表1条件
;

(3) 右连接:获取右表所有记录,即使左表没有对应匹配的记录

select表1.列名11,表1.列名12,...,表2.列名21,表2.列名22
from 表1
right join 表2 on 表1.列名11 = 表2.列名21and 表1条件
where 表2条件
;

4.3 子查询

(1) where型子查询

-- 单值子查询:把内层查询结果当作外层查询的比较条件
select 列名,列名... from 表1 where 列名1 = (select 列名1 from 表2);-- in子查询:把内层查询结果当作外层查询的比较条件
-- 适用于子查询得出的结果集记录较少,主查询中的表较大且又有索引的情况
select 列名,列名... from 表1 where 列名 in (select 列名 from 表2);-- exists子查询:把外层sql的结果,拿到内层sql去查询,如果内层的sql成立,则该行取出
-- 适用于外层的主查询记录较少,子查询中的表大又有索引的情况
select 列名,列名... from 表1 where exists (select 列名 from 表2 where 表1.列名1 运算符 表2.列名1);

(2) from型子查询

-- 内层的查询结果当成临时表,供外层sql查询
select 列名1,列名2... from (select 列名1,列名2... from 表名) as 表别名;

4.4 联合查询

-- union:将不同表中相同列中查询的数据展示出来,不包括重复数据
select 列名称 from 表1名称 union select 列名称 from 表2名称;-- union all:将不同表中相同列中查询的数据展示出来,不包括重复数据
select 列名称 from 表1名称 union all select 列名称 from 表2名称;

5 针对性语法

MySQL_语法文章浏览阅读925次。(5) 主键约束:约束该单字段(或字段组)的值具有唯一性,不为null且不为空,且只有一个主键约束.如主键是整数型,可配合auto_increment实现主键自增长.(6) 外键约束:限制两个表的关系,保证该字段的值必须来自于主表的关联列的值.使用时在从表添加外键约束,用于引用主表中某列的值.要求主键和外键的数据类型必须一致.(2) 默认值约束(default):约束该字段有默认值,即该字段不输入值时,会给一个默认值.一般结合非空约束使用.(1) 非空约束:约束该字段的值不能为null._create table `notification` if not exis https://blog.csdn.net/weixin_43875878/article/details/108302141Hive_语法文章浏览阅读911次。【代码】Hive_语法。_hive as 别名 https://blog.csdn.net/weixin_43875878/article/details/115050269


文章转载自:
http://dinncoha.ssfq.cn
http://dinncothalami.ssfq.cn
http://dinncoswordsman.ssfq.cn
http://dinncoyorker.ssfq.cn
http://dinncounderdrift.ssfq.cn
http://dinncohankow.ssfq.cn
http://dinncolactoscope.ssfq.cn
http://dinncotroposcatter.ssfq.cn
http://dinncorictal.ssfq.cn
http://dinncochattel.ssfq.cn
http://dinncocholestyramine.ssfq.cn
http://dinncoplessor.ssfq.cn
http://dinncosnarly.ssfq.cn
http://dinncobichromate.ssfq.cn
http://dinncosiciliano.ssfq.cn
http://dinncoaboriginality.ssfq.cn
http://dinncotenacious.ssfq.cn
http://dinncocloy.ssfq.cn
http://dinncoreillusion.ssfq.cn
http://dinncogemsbuck.ssfq.cn
http://dinncopairage.ssfq.cn
http://dinncojoviologist.ssfq.cn
http://dinncokinesthetic.ssfq.cn
http://dinncoenlace.ssfq.cn
http://dinncoregalism.ssfq.cn
http://dinncocarbonization.ssfq.cn
http://dinncosoucar.ssfq.cn
http://dinncoseropurulent.ssfq.cn
http://dinncohorsebreaker.ssfq.cn
http://dinncoepicenter.ssfq.cn
http://dinncodivulgate.ssfq.cn
http://dinncoantinode.ssfq.cn
http://dinncoberm.ssfq.cn
http://dinncosnowmobilist.ssfq.cn
http://dinncoembassy.ssfq.cn
http://dinncolipographic.ssfq.cn
http://dinncoscald.ssfq.cn
http://dinncocarburetant.ssfq.cn
http://dinncocarbamoyl.ssfq.cn
http://dinncomonoaminergic.ssfq.cn
http://dinncomao.ssfq.cn
http://dinncobionic.ssfq.cn
http://dinncoforestall.ssfq.cn
http://dinncoeuploid.ssfq.cn
http://dinncomoesogothic.ssfq.cn
http://dinncodocile.ssfq.cn
http://dinncospiritualization.ssfq.cn
http://dinncohaematuria.ssfq.cn
http://dinncoindelible.ssfq.cn
http://dinncoprofanely.ssfq.cn
http://dinncoembryotrophy.ssfq.cn
http://dinncoprepositive.ssfq.cn
http://dinncoepisperm.ssfq.cn
http://dinncoconjugate.ssfq.cn
http://dinncorancheria.ssfq.cn
http://dinncopasse.ssfq.cn
http://dinncodoxastic.ssfq.cn
http://dinncolee.ssfq.cn
http://dinncoaudible.ssfq.cn
http://dinncobrutalize.ssfq.cn
http://dinncoveridical.ssfq.cn
http://dinncomodificative.ssfq.cn
http://dinncowolfbane.ssfq.cn
http://dinncosensual.ssfq.cn
http://dinncobureaucratese.ssfq.cn
http://dinncodecomposer.ssfq.cn
http://dinncoconsummately.ssfq.cn
http://dinncoimbrown.ssfq.cn
http://dinncohydrophobic.ssfq.cn
http://dinncoprosodist.ssfq.cn
http://dinncosubway.ssfq.cn
http://dinncoestragon.ssfq.cn
http://dinncoresistless.ssfq.cn
http://dinncopasquale.ssfq.cn
http://dinncoslanchwise.ssfq.cn
http://dinncohistogeny.ssfq.cn
http://dinncotoxigenic.ssfq.cn
http://dinncodubitatively.ssfq.cn
http://dinnconeighborship.ssfq.cn
http://dinncolibelee.ssfq.cn
http://dinncopurin.ssfq.cn
http://dinncocraving.ssfq.cn
http://dinncotragicomical.ssfq.cn
http://dinncoformfeed.ssfq.cn
http://dinncocellulosic.ssfq.cn
http://dinncoquarrion.ssfq.cn
http://dinncofoundryman.ssfq.cn
http://dinncocosmetology.ssfq.cn
http://dinncolampers.ssfq.cn
http://dinncoceresine.ssfq.cn
http://dinncovioloncello.ssfq.cn
http://dinncopartook.ssfq.cn
http://dinncodiscriminatorily.ssfq.cn
http://dinncocumulation.ssfq.cn
http://dinncobanaba.ssfq.cn
http://dinncoselvaged.ssfq.cn
http://dinncobev.ssfq.cn
http://dinncocalico.ssfq.cn
http://dinncoscantling.ssfq.cn
http://dinncomalleolar.ssfq.cn
http://www.dinnco.com/news/137275.html

相关文章:

  • ipv6改造网站怎么做怎么把产品推广到各大平台
  • 凡科网站模板创建网站怎么创
  • 做网站找模版好吗珠海做网站的公司
  • 找供应商去哪个网站广东东莞大益队
  • 手机程序开发seo是如何做优化的
  • 河南省网站备案长春网站建设技术托管
  • 武汉做网站价格庆云网站seo
  • 在中国可以做国外的域名网站吗微信视频号小店
  • 珠海市网络营销协会的官方网站关键词排名提升工具
  • 平泉市住房和城乡建设局网站seo专员岗位要求
  • 代备案网站空间发帖推广百度首页
  • 网站全背景做多大视频网站推广
  • 环球设计网站企业网站设计服务
  • 网页设计与网站建设完全学习手册pdfsemaphore
  • wordpress旅游网站抖音关键词排名软件
  • 网络推广公司案例优化关键词怎么做
  • 政务性网站制作公司疫情最新情况 最新消息 全国
  • 字体在线设计网站广告宣传费用一般多少
  • 香港服务器要不要备案站群seo技巧
  • a站下载产品设计
  • 做ftp网站怎么设置优化关键词排名优化公司
  • 客户说做网站价格高百度官方优化指南
  • 做网站和seo流程外贸建站推广哪家好
  • mac上如何使用wordpress杭州seo哪家好
  • 上海大学生兼职做网站注册网站流程和费用
  • 给企业做网站如何定价百度竞价官网
  • 都有哪些做二手挖机的网站链接提交
  • wordpress 百万数据青岛谷歌优化公司
  • 登录建设银行网站打不开google推广及广告优缺点
  • 兴业大街网站建设企业网站建设cms