MySQL 练习三

mysql练习(三) mysql练习(三)MySql的内置函数concat函数length函数left函数 截取字符串right函数 截取字符串substring 从中间截取字符串ltrim 去除左空格rtrim 去除右空格trim 去除空格round 四舍五入rand 产生随机数日期时间相关函数存储过程视图事务索引mysql命令行常用命令 MySql的内置函数 mysql的内置函数是mysql数据库专有的函数,只有mysql中才能够使用。 mysql内置函数可以在where后面使用。 concat函 阅读详情

  1. select sname,sex,class from student;
  2. select distinct depart from teacher;
  3. select * from student;
  4. select * from score where degree between 60 and 80;
  5. select * from score where degree in(85,86,88);
  6. select * from student where class=’95031’ or sex=’女’;
  7. select * from student order by class desc;
  8. select * from score order by cno asc,degree desc;
  9. select count(*) from student where class=98031;
  10. select sno,degree from score where degree =(select max(degree) from score);
  11. select avg(degree) from score where cno = '3-105';
  12. select cno,avg(degree) from score where cno like ‘3%’ group by cno having count(*) > 5;
  13. select cno,max(degree) a ,min(degree) b from score group by cno having a<90 and b> 70;
  14. select s1.cno,s1.degree,s2.sname from score s1 join student s2 on s1.sno = s2.sno;
  15. select s1.sname ,s3.cname,s2.degree from score s2 join student s1 on s1.sno=s2.sno join course s3 on s2.cno = s3.cno;;
  16. select avg(degree) from score s1 join (select sno from student where class=95033) s2 on s1.sno = s2.sno group by cno;
  17. select * from score where cno = '3-105' and degree > (select degree from score where sno = 109 and cno = '3-105');
  18. select sno from score group by sno having count(*) > 1 and sno not in(select s1.sno from score s1 join(select cno,max(degree) a from score group by cno) s2 on s1.cno = s2.cno and s1.degree = s2.a)
  19. select * from score where cno = '3-105' and degree > (select degree from score where sno = 109 and cno = '3-105');
  20. select sno,sname,birthday from student where sno != 108 and year(birthday) = (select year(birthday) from student where sno = 108);
  21. select degree from score where cno in( select cno from course where tno in (select tno from teacher where tname = '张旭'))
  22. select tname from teacher where tno in(select tno from course where cno in(select cno from score group by cno having count(*) > 5));
  23. select * from student where class in (95033,95031);
  24. select distinct cno from score where degree > 85;
  25. select sno,degree from score where cno in (select cno from course where tno in (select tno from teacher where depart = ‘计算机系’));
  26. select t1.tname,t1.prof from teacher t1,teacher t2 where t1.prof != t2.prof and t1.tno != t2.tno and t1.depart = t2.depart;
  27. select s1.cno,s1.sno,s1.degree from (select * from score where cno = '3-105') s1 join (select * from score where cno = '3-245') s2 on s1.sno = s2.sno and s1.degree > s2.degree order by degree desc;
  28. select s1.cno,s1.sno,s1.degree from (select * from score where cno = '3-105') s1 join (select * from score where cno = '3-245') s2 on s1.sno = s2.sno and s1.degree > s2.degree;
  29. select tname,depart from teacher where tno in (select tno from course);
  30. select tname,depart from teacher where tno not in (select tno from course);
  31. select sname,sex,birthday from student;select tname,sex,birthday from teacher;
  32. select s2.sno from (select * from score where sno = 103) s1 join score s2 on s1.cno = s2.cno and s1.sno != s2.sno group by s2.sno having count(*) = (select count(*) from score where sno = 103)
  33. select sname from student where sno in (select sno from score group by sno having count(*) = (select count(*) from course ));

 

【MySQL】练习三 SQL语言 主要内容 1、SQL语言的基本功能 2、基本表、视图的概念 阅读详情

相关推荐

【鸿蒙南向开发】OpenHarmony——分布式数据对象之功能实践

通过本文的学习可了解到分布式数据对象的主要接口、大致调用方法和功能实现等。结合对应内容,可以进一步对分布式数据对象同步机制做深度学习。下一步,(1) 着重理解同步组网的构建原理。(2) 着重理解同步组网内,监听change和status变化的实现。●如果你觉得这篇内容对你还蛮有帮助,我想邀请你帮我三个小忙:●关注小编,同时可以期待后续文章ing🚀,不定期分享原创知识。

HarmonyOS_666的博客 1099

MySQL实验三:查询练习

整理实验的查询练习题,数据库表会提供建立的sql语句,个人整理版非官方,如果有错误或者疑问,欢迎在评论区提出见解!Navicat9以上mysql5.7或者mysql8都可以本篇设计大量的查询语句,初学者可能会对有些题产生困惑,这很正常,就好像人终究会被其年少不可得之物困扰一生,也会为一时一景解开其一生的困惑。加油吧少年!!

程序员小火龙的知识分享 5460

恭喜,恭喜,iMouse爱鼠XP版全面发布测试,苹果手机自动化测试必须

电脑控制苹果手机,免越狱,免签名,自动化测试

qq_41057894的博客 1076

Mysql练习三

INSERT INTO `worker` (`部门号`, `职工号`, `工作时间`, `工资`, `政治面貌`, `姓名`, `出生。INSERT INTO `worker` (`部门号`, `职工号`, `工作时间`, `工资`, `政治面貌`, `姓名`, `出生。INSERT INTO `worker` (`部门号`, `职工号`, `工作时间`, `工资`, `政治面貌`, `姓名`, `出生。素材: 表名:worker-- 表中字段均为中文,比如 部门号 工资 职工号 参加工作 等。

xz15881991074的博客 782

Axure rp9 中继器新建表格

Axure rp9 中继器新建表格

weixin_49295490的博客 1656

Ubuntu使用gstreamer开发USB相机应用(一)

Ubuntu使用gstreamer开发USB相机应用(一) 包括:gstreamer安装,测试。使用v4l2测试USB相机。使用gstreamer采集相机

Alon1787的博客 2746

MySql复习—(练习三—排序数据)

【代码】MySql复习—(练习三)

2202_75381448的博客 158

大数据数据埋点技术面试题及参考答案(持续更新)

事件:指的是用户执行的具体动作,如页面浏览、按钮点击、商品购买等。事件是触发数据记录的直接原因,是分析用户行为的关键点。属性:是与事件相关的额外信息,可以提供关于事件的更多上下文。例如,用户点击的按钮颜色、大小、页面位置等。属性有助于更细致地分析用户行为,理解事件发生的具体情境。事件和属性共同构成了数据埋点的数据模型,它们使得收集的数据具有可分析性,从而可以用于深入理解用户行为和优化产品。

大模型大数据攻城狮的专栏 2099

MYSQL练习三答案

answer开头表为对应题号答案形成的数据表。

南州博客 453

第3版•系统集成项目管理工程师(中级) │ 第6章 数据工程

🥏第3版•系统集成项目管理工程师(中级) │ 第6章 数据工程

✨ 欢迎来到【Seal ^_^ 的CSDN博客】!✨ 1万+

OPPO 后端校招面试,过于简单了!

你好,我是 Guide。2026 届秋招陆续开奖公司的越来越多了,今天来看一家手机厂 OPPO。前几天,已经分享了和今年校招开奖的情况。其中,小红书的薪资最为炸裂,大白菜一年都能给到 51w+。不过,相对应的工作强度和压力也是真的难顶,确实很难有钱多又轻松的活!OV (OPPO 和 Vivo)这几年发展真还可以的,这两家的高端机口碑都不错。本人也是最近入手了一款 Vivo 的上一代旗舰,拍照是真的不错啊!每个月会有 1.2k 生活补贴,生活费是按照 8 % 缴纳。

JavaGuide 757

MySQL数据库练习【三】

MySQL数据库练习【三】

qq_45740503的博客 1857

基于STM32F4XX 、HAL库的GXHT30C温湿度传感器驱动应用C语言程序设计

define GXHT30C_STATUS_WRITE_CHK (1 << 0) // 写数据校验状态。#define GXHT30C_STATUS_HUMI_TRACK (1 << 11) // 湿度跟踪报警。#define GXHT30C_STATUS_TEMP_TRACK (1 << 10) // 温度跟踪报警。#define GXHT30C_STATUS_CMD_STATUS (1 << 1) // 命令执行状态。

PP_Cottage的博客 235

Leetcode-Mysql练习 三

月份(month)可以取下列值 ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]。Dog 查询结果的质量为 ((5 / 1) + (5 / 2) + (1 / 200)) / 3 = 2.50。Cat 查询结果的质量为 ((2 / 5) + (3 / 3) + (4 / 7)) / 3 = 0.66。产品 1 的平均售价 = ((100 * 5)+(15 * 20) )/ 115 = 6.96。

weixin_61524392的博客 1229

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

MySQL练习三

mysql> insert student values(901,'张三丰','男',2002,'计算机系','北京市海淀区');mysql> insert student values(906,'王心凌','女',1998,'计算机系','湖南省衡阳市');mysql> insert student values(905,'王翰','男',2004,'英语系','福建省厦门市');mysql> insert into score values(null,906,'英语',83);

2302_77625887的博客 945

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

MySQL作业三(MySQL练习50题)

MySQL第三次作业

m0_74747565的博客 941

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

MYSQL 查询练习③

③①查询成绩比该课程平均成基低的同学的成绩表 select cno,avg(degree) from score group by cno; #查询课程号的平均成绩 select * from score where degree<(select avg(degree) from score group by cno); # 不能成立因为,后面的语句产生的是一个平均值表,不能进...

qq_43256229的博客 367

Mysql 练习三

mysql日常练习

kaka的博客 963

mysql练习题目介绍三

mysql数据结构表如下:希望能够好好的参考学习,每天学一点,就进步一点。 update练习 drop table if exists employee; create table if not exists employee (     id int,     name varchar(20),     sex varchar(10),     birthday date,     sala...

从放弃到开始 519

MYSQL练习三

数据库中根据以下图示创建表,表结构如下,并插入以下数据,完成下面的。

南州博客 95

mysql三表关联查询练习

三张表: 1:公司表 2、员工表 3、中间关联表 -- 关联查询方式查询张飞在哪个公司 SELECT company.company_name AS '张飞公司' FROM company INNER JOIN com_emp ON com_emp.company_id = company.company_id INNER JOIN emp ON...

蔡定努 3520

MySQL练习题(三)

【代码】MySQL练习题(三)

SHI940637335的博客 344

mysql练习题三

一.创建和管理表 #第10章_创建和管理表 SELECT * FROM `order`; #1. 创建和管理数据库 #1.1 如何创建数据库 #方式1: CREATE DATABASE mytest1; # 创建的此数据库使用的是默认的字符集 #查看创建数据库的结构 SHOW CREATE DATABASE mytest1; #方式2:显式了指名了要创建的数据库的字符集 CREATE DATABASE mytest2 CHARACTER SET 'gbk'; # SHOW CREATE DA

m0_59708269的博客 353

MySQL基础练习(三)

经过之前两次的学习,这次用MySQL进行略微复杂的操作练习 各部门工资最高的员工 首先创建表employee和表department。如下 我们需要查询每个部门工资最高的员工 select a.Name as Department,b.Name as Employee,b.Salary from department a join (select DepartmentId,N...

weixin_30498921的博客 117
上一篇: MySQL 练习二
下一篇: 数据库触发器
Doge_One
博客等级 码龄3年 385粉丝 50原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值