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

开封市网站建设_网站建设公司_UI设计_seo优化

网站建设的必要性及意义,旅游网站的首页怎么做,西安网站建站,在线logo-- 查询所有数据库 show databases; -- 创建数据库#xff0c;数据库名为mydatabase create database mydatabase; -- 如果没有名为 mydatabase的数据库则创建#xff0c;有就不创建 create database if not exists mydatabase; -- 如果没有名为 mydatabase的数据库则创建…-- 查询所有数据库 show databases; -- 创建数据库数据库名为mydatabase create database mydatabase; -- 如果没有名为 mydatabase的数据库则创建有就不创建 create database if not exists mydatabase; -- 如果没有名为 mydatabase的数据库则创建有就不创建数据库字符编码设置为utf8mb4 create database if not exists mydatabase character set utf8mb4; -- 使用数据库 use mydatabase; -- 删除名为mydatabase的数据库 drop database mydatabase; -- 如果有名为 mydatabase的数据库则删除没有就不删除 drop database if exists mydatabase; -- 查看mydatabase数据库的表结构 desc mydatabase; -- 创建表,comment用于字段说明创建一个表有id,name,gender,age,class字段 create table mytable(id int not null ,name varchar(20) not null comment 姓名,gender varchar(2) not null comment 性别,age int not null comment 年龄,class varchar(20) not null comment班级 ); -- 删除名为mytable的表 drop table mytable; -- 如果存在则删除mytable表不存在就不删除 drop table if exists mytable; -- 数据库主要有增删查改等操作 -- 创建一个学生表student字段有id ,sn, name,qq_meail create table student (id int ,sn int comment 学号,name varchar (20) comment 姓名 ,qq_email varchar(32) comment qq邮箱 ); -- 增插入数据 insert into student (id,sn,name,qq_email) values (1,10000,张三,123456qq.com); -- 可以指定列插入   insert into student (sn,name,qq_email) values( 1002,李四,234567qq.com); -- 查查询记录  -- 查询student表里所有字段  -- 一般不用这种全列查询因为全列查询效率低 select * from student; -- 查询student表里的指定列 sn,name,qq_email select sn,name,qq_email from student; -- 查询字段也可以进行表达式运算 select sn10,name,qq_email from student; -- 再比如插查询字段为id, name, chninese,english,math三门成绩相加 select id,name,chineseenglishmath from student; -- 数据库约束    -- NULL约束当字段设置为not null,那么这一列就不能为空 create table student (id int  not null ,name varchar(32) not null,age int not null); -- unique约束:指定字段的某列是唯一的不可以重复的  -- 创建一个学生表id为主键自增sn设置为唯一的unique drop table if exists student ;create table student(id int not null primary key auto_increment,sn int unique comment 学号,name varchar(32) not null comment 名字); -- default约束规定没有给列赋值时可以给一个默认值 -- 当name不知道时设置默认为未知   drop table if exists student;create table student (id int not null primary key auto_increment,sn int unique comment 学号,name varchar(32) default  未知 comment 名字); -- 主键约束  -- id为主键且设为自增 drop table if exists student;create table student (id int not null primary key auto_increment,sn int  comment 学号,name varchar(32) comment 名字); -- 外键约束外键约束用来关联表之间的关系可以用来关联其他表的主键  -- 添加外键约束语法  foreign key (字段名) references (主表的列)   1.查询与过滤 题目现在运营想要查看用户信息表中所有的数据请你取出相应结果 select*from user_profile; 题目现在运营同学想要用户的设备id对应的性别、年龄和学校的数据请你取出相应数据 select device_id,gender,age,university from user_profile; 题目现在运营需要查看用户来自于哪些学校请从用户信息表中取出学校的去重数据。 select distinct university from user_profile; 题目现在运营只需要查看前2个用户明细设备ID数据请你从用户信息表 user_profile 中取出相应结果。 -- LIMIT n OFFSET m从第m1条开始取n条数据 select device_id from user_profile limit 2 offset 0; 题目现在你需要查看前2个用户明细设备ID数据并将列名改为 user_infos_example,请你从用户信息表取出相应结果。 select device_id as user_infos_example from user_profile limit 2 offset 0; 题目现在运营想要筛选出所有北京大学的学生进行用户调研请你从用户信息表中取出满足条件的数据结果返回设备id和学校。 select device_id,university from user_profile where university北京大学; 题目现在运营想要针对24岁以上的用户开展分析请你取出满足条件的设备ID、性别、年龄、学校。 select device_id,gender,age,university from user_profile where age24; 题目现在运营想要针对20岁及以上且23岁及以下的用户开展分析请你取出满足条件的设备ID、性别、年龄。 select device_id,gender,age from user_profile where age20 and age23; 题目现在运营想要查看除复旦大学以外的所有用户明细请你取出相应数据 select device_id,gender,age,university from user_profile where university!复旦大学; 题目现在运营想要对用户的年龄分布开展分析在分析时想要剔除没有获取到年龄的用户请你取出所有年龄值不为空的用户的设备ID性别年龄学校的信息。 select device_id,gender,age,university from user_profile where age is not null;
http://www.ihoyoo.com/news/79944.html

相关文章:

  • 企业设计网站系统石家庄网站建设公司排名
  • 策划网站有哪些山东住房城乡建设部网站
  • 网站服务器地址怎么查询普通话
  • 手机网站制作推荐汽车4s店网站建设方案
  • 深圳网站设计设计网站建设内容的重点
  • 设计公司设计seo排名大概多少钱
  • 行业网站建设哪家专业哪些网站做外链好
  • 厦门做企业网站多少钱宁波装修公司网站制作
  • 西宁建设网站wordpress主题设置插件
  • 网站重复页面网站关键词 提醒
  • 基本信息型网站有哪些入职简历模板
  • 如何知道网站的字体临沂市住房和城乡建设局网站
  • 一些做设计素材的网站wordpress更换字体
  • 酒店网站模板下载上海关键词排名搜索
  • 青海做网站最好的公司wordpress怎么导入demo文件夹
  • 网站空间是指什么本地拖拽网站建设
  • 网络建站 响应式网站乐清网站设计公司哪家好
  • 网站备案 流程广西建筑培训网
  • 做网站需要什么资质网站开发后期维护更新
  • 名字做头诗的网站wordpress 页面模板
  • 做窗帘什么网站qq是哪家公司的产品
  • 建设小微公司网站需要多少钱城阳 网站建设
  • 网站图片用什么做笔记网站开发代码
  • 网站开发的硬件环境建筑安全员证查询网上查询
  • 商城购物网站定制网页界面设计中常用的中英文字体有哪些
  • 做的好的区块链网站logo图案免费
  • 安徽网站搭建工商注册登记流程
  • 不限流量网站空间成都计算机培训机构哪个最好
  • 设计数码产品宣传网站淘宝做网站很便宜
  • 兰州网站制作公司在哪里网站设计项目总结