随笔分类 - 多测师_Mysql数据库
摘要:
阅读全文
摘要:一、错误信息 CREATE TABLE `file` ( `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件md5', `name` varchar(128) CHARACTER
阅读全文
摘要:这是用Python写的插入数据的脚本 import pymysql db = pymysql.connect(host="192.168.43.131", user="root", password="123456", database="test", port=3306) cur = db.cur
阅读全文
摘要:一、第一种方法:通过创建不同线程组实现 1、创建不同的线程组,然后把不同的请求放在不同的线程组里面,每个线程组里面加入Synchronizing Timer集合点,然后添加一个用表格察看结果 2、这个比较适合单接口场景,如果是关联接口效果就会有影响 3、这个主要是利用jmeter的线程组是并发执行来
阅读全文
摘要:编写一个SQL查询来报告 Person 表中每个人的姓、名、城市和州。如果 personId 的地址不在 Address 表中,则报告为空 null 。 以 任意顺序 返回结果表。 示例 : Person表: + + + + | personId | lastName | firstName | +
阅读全文
摘要:MYSQL 慢查询使用方法 MYSQL 慢查询介绍 分析 MySQL 语句查询性能的问题时候,可以在 MySQL 记录中查询超过指定时间的语 句,我们将超过指定时间的 SQL 语句查询称为“慢查询”。MYSQL 自带的慢查询分析工 具 mysqldumpslow 可对慢查询日志进行分析:主要功能是,
阅读全文
摘要:乐观锁和悲观锁的理解及如何实现,有哪些实现方式? 悲观锁:总是假设最坏的情况,每次去拿数据的时候都认为别人会修改,所以每次在拿数据的时候 都会上锁,这样别人想拿这个数据就会阻塞直到它拿到锁。 传统的关系型数据库里边就用到了很多这种锁机制,比如行锁,表锁等,读锁,写锁等,都是在做 操作之前先上锁。再比
阅读全文
摘要:一)使用Python+Flask+MySQL+Redis开发简单接口实例 flaskDemo框架 本接口项目的技术选型:Python+Flask+MySQL+Redis,通过 Python+Falsk 来开发接口,使用 MySQL 来存储用户信息,使用 Redis 用于存储token,目前为纯后端接
阅读全文
摘要:int(M) 在 integer 数据类型中,M 表示最大显示宽度。在 int(M) 中,M 的值跟 int(M) 所占多少存储空间并无任何关系。 int(3)、int(4)、int(8) 在磁盘上都是占用 4 btyes 的存储空间。说白了,除了显示给用户的方式有点不同外,int(M) 跟 int
阅读全文
摘要:1.1 select fengshu from table where name="张三" and kecheng="语文"; 1.2 update table set fengshu=23 where name="张三" and kecheng="语文"; 1.3 delete from tabl
阅读全文
摘要:第一题:select SC1.S# from SC SC1 JOIN SC SC2 ON SC1.S#=SC2.S# WHERE SC1.C#='001' AND SC2.C#='002' AND SC1.score>SC2.score; 第二题:select S#,AVG(score) as '平
阅读全文
摘要:第一题: select score from student where course = '语文' and name = '张三'; 第二题: update student set score = 100 where course = '数学' and name = '李四'; 第三题: inse
阅读全文
摘要:查询当天数据 select * from tab where FROM_UNIXTIME(fabutime, '%Y%m%d') = 20121217; mysql TO_DAYS(date) 函数 TO_DAYS(date) 给定一个日期date, 返回一个天数 (从年份0开始的天数 )。 最近一
阅读全文
摘要:def foo(value): dict1 = {} a = 0 num =0 for i in range(len(value)): if value[i] in dict1: num = max(dict1[value[i]],num) a = max(i-num+1, a) dict1[val
阅读全文
摘要:第一题: update CAR_RECORD set Car_Color = 'yellow' where Car_Num = "浙A12A26"; 第二题: select Rec_type as '违法类型',count(Rec_Type) as '数量' from CAR_DPRECORD gr
阅读全文
摘要:答案一: select name from 表名 group by name having min(fenshu)>80; 答案二: select name from 表名 group by name having name not in (select name from 表名 where fen
阅读全文
摘要:多表题目: 列出每一个部门中年纪最大的员工姓名,部门名称 select name,dept_name,age from dept RIGHT JOIN emp e on dept.dept1=e.dept2 where (select count(*) from emp em WHERE em.ag
阅读全文
摘要:#coding=utf-8 ''' python操作mysql数据库 robotframework框架中用到了MySQLdb中间件和DatabaseLibrary第三方库 author:多测师_王sir ''' ''' 创建数据库连接对象需要的参数 host string, host to conn
阅读全文