十一个高级MySql面试题


Posted in 面试题 onOctober 06, 2014
1. Explain MySQL architecture. – The front layer takes care of network connections and security authentications, the middle layer does the SQL query parsing, and then the query is handled off to the storage engine. A storage engine could be either a default one supplied with MySQL (MyISAM) or a commercial one supplied by a third-party vendor (ScaleDB, InnoDB, etc.)
2. Explain MySQL locks. – Table-level locks allow the user to lock the entire table, page-level locks allow locking of certain portions of the tables (those portions are referred to as tables), row-level locks are the most granular and allow locking of specific rows.

3. Explain multi-version concurrency control in MySQL. – Each row has two additional columns associated with it – creation time and deletion time, but instead of storing timestamps, MySQL stores version numbers.
4. What are MySQL transactions? – A set of instructions/queries that should be executed or rolled back as a single atomic unit.
5. What’s ACID? – Automicity – transactions are atomic and should be treated as one in case of rollback. Consistency – the database should be in consistent state between multiple states in transaction. Isolation – no other queries can access the data modified by a running transaction. Durability – system crashes should not lose the data.
6. Which storage engines support transactions in MySQL? – Berkeley DB and InnoDB.
7. How do you convert to a different table type? – ALTER TABLE customers TYPE = InnoDB
8. How do you index just the first four bytes of the column? – ALTER TABLE customers ADD INDEX (business_name(4))
9. What’s the difference between PRIMARY KEY and UNIQUE in MyISAM? – PRIMARY KEY cannot be null, so essentially PRIMARY KEY is equivalent to UNIQUE NOT NULL.
10. How do you prevent MySQL from caching a query? – SELECT SQL_NO_CACHE …
11. What’s the difference between query_cache_type 1 and 2? – The second one is on-demand and can be retrieved via SELECT SQL_CACHE … If you’re worried about the SQL portability to other servers, you can use SELECT /* SQL_CACHE */ id FROM … – MySQL will interpret the code inside comments, while other servers will ignore it.

Tags in this post...

面试题 相关文章推荐
方法名是否可以与构造器的名字相同
Jun 04 面试题
群胜软件Java笔试题
Sep 29 面试题
编码实现字符串转整型的函数
Jun 02 面试题
介绍一下sql server的安全性
Aug 10 面试题
一道SQL存储过程面试题
Oct 07 面试题
Oracle性能调优原则
May 03 面试题
如何开启linux的ssh服务
Jun 03 面试题
Linux操作面试题
Feb 11 面试题
如何利用cmp命令比较文件
Apr 11 面试题
十一个高级MySql面试题
Oct 06 面试题
垃圾回收的优点和原理
May 16 面试题
编程用JAVA解析XML的方式
Jul 07 面试题
遇到的Mysql的面试题
Jun 29 #面试题
一些关于MySql加速和优化的面试题
Jan 30 #面试题
MYSQL支持事务吗
Aug 09 #面试题
MYSQL基础面试题
May 13 #面试题
mysql有关权限的表都有哪几个
Apr 22 #面试题
介绍一下mysql的日期和时间函数
Mar 28 #面试题
介绍一下MYSQL常用的优化技巧
Oct 25 #面试题
You might like
php生成excel列序号代码实例
2013/12/24 PHP
php实现与erlang的二进制通讯实例解析
2014/07/23 PHP
PHP生成不重复随机数的方法汇总
2014/11/19 PHP
在html页面上拖放移动标签
2010/01/08 Javascript
jquery的flexigrid无法显示数据提示获取到数据
2013/07/19 Javascript
javascript禁用Tab键脚本实例
2013/11/22 Javascript
javascript异步编程的4种方法
2014/02/19 Javascript
JavaScript中的ubound函数使用实例
2014/11/04 Javascript
jQuery中slideUp()方法用法分析
2014/12/24 Javascript
修复bash漏洞的shell脚本分享
2014/12/31 Javascript
javascript实现的淘宝旅行通用日历组件用法实例
2015/08/03 Javascript
轻松实现jquery手风琴效果
2016/01/14 Javascript
bootstrap下拉菜单使用方法解析
2017/01/13 Javascript
javascript阻止事件冒泡和浏览器的默认行为
2017/01/21 Javascript
浅谈vue的iview列表table render函数设置DOM属性值的方法
2017/09/30 Javascript
vuex提交state&&实时监听state数据的改变方法
2018/09/16 Javascript
LayUI动态设置checkbox不显示的解决方法
2019/09/02 Javascript
JavaScript中reduce()的5个基本用法示例
2020/07/19 Javascript
在实例中重学JavaScript事件循环
2020/12/03 Javascript
[01:26]神话结束了,却也刚刚开始——DOTA2新英雄玛尔斯驾临战场
2019/03/10 DOTA
Python 使用os.remove删除文件夹时报错的解决方法
2017/01/13 Python
Python绘图Matplotlib之坐标轴及刻度总结
2019/06/28 Python
在python image 中实现安装中文字体
2020/05/16 Python
python中pivot()函数基础知识点
2021/01/03 Python
利用CSS3实现开门效果实例源码
2016/08/22 HTML / CSS
HTML5 UTF-8 中文乱码的解决方法
2013/11/18 HTML / CSS
Shell脚本如何向终端输出信息
2014/04/25 面试题
机电一体化毕业生求职信
2013/11/02 职场文书
卖房协议书
2014/04/11 职场文书
致共产党员倡议书
2014/04/16 职场文书
2014年党员加强作风建设思想汇报
2014/09/15 职场文书
热情服务标语
2014/10/07 职场文书
2015年机关党委工作总结
2015/05/23 职场文书
2015迎新晚会开场白
2015/07/17 职场文书
python+opencv实现视频抽帧示例代码
2021/06/11 Python
i5-10400f处理相当于i7多少水平
2022/04/19 数码科技