十一个高级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...

面试题 相关文章推荐
Yahoo-PHP面试题4
May 05 面试题
C语言开发工程师测试题
Dec 20 面试题
值类型与引用类型有什么不同?请举例说明?并分别列举几种相应的数据类型
Oct 24 面试题
什么是View State?
Jan 27 面试题
Hashtable 添加内容的方式有哪几种,有什么区别?
Apr 08 面试题
linux面试题参考答案(4)
Sep 21 面试题
如何开启linux的ssh服务
Jun 03 面试题
什么是Linux虚拟文件系统VFS
Aug 25 面试题
init进程的作用
Aug 20 面试题
九州传奇上机题
Jul 10 面试题
一套英文Java笔试题面试题
Apr 21 面试题
Ruby如何进行文件操作
Jul 17 面试题
遇到的Mysql的面试题
Jun 29 #面试题
一些关于MySql加速和优化的面试题
Jan 30 #面试题
MYSQL支持事务吗
Aug 09 #面试题
MYSQL基础面试题
May 13 #面试题
mysql有关权限的表都有哪几个
Apr 22 #面试题
介绍一下mysql的日期和时间函数
Mar 28 #面试题
介绍一下MYSQL常用的优化技巧
Oct 25 #面试题
You might like
golang 调用 php7详解及实例
2017/01/04 PHP
PHP实现对文件锁进行加锁、解锁操作的方法
2017/07/04 PHP
PHP PDOStatement::getColumnMeta讲解
2019/02/01 PHP
图片上传插件jquery.uploadify详解
2013/11/15 Javascript
JavaScript使用HTML5的window.postMessage实现跨域通信例子
2014/04/11 Javascript
JavaScript事件委托的技术原理探讨示例
2014/04/17 Javascript
js、jquery图片动画、动态切换示例代码
2014/06/03 Javascript
JS来动态的修改url实现对url的增删查改
2014/09/05 Javascript
jQuery实现页面滚动时动态加载内容的方法
2015/03/20 Javascript
JavaScript实现打字效果的方法
2015/07/10 Javascript
jquery实现邮箱自动填充提示功能
2015/11/17 Javascript
基于jQuery实现鼠标点击导航菜单水波动画效果附源码下载
2016/01/06 Javascript
BootStrap的select2既可以查询又可以输入的实现代码
2017/02/17 Javascript
Javascript之图片的延迟加载的实例详解
2017/07/24 Javascript
浅谈vue首屏加载优化
2018/06/28 Javascript
js操作table中tr的顺序实现上移下移一行的效果
2018/11/22 Javascript
vue+koa2搭建mock数据环境的详细教程
2020/05/18 Javascript
[05:09]第二届DOTA2亚洲邀请赛决赛日比赛集锦:iG 3:0 OG夺冠
2017/04/05 DOTA
python 文件和路径操作函数小结
2009/11/23 Python
Python解惑之True和False详解
2017/04/24 Python
Python语言实现百度语音识别API的使用实例
2017/12/13 Python
Python中使用支持向量机SVM实践
2017/12/27 Python
详解淘宝H5 sign加密算法
2020/08/25 HTML / CSS
华润集团网上药店:健一网
2016/09/19 全球购物
国家地理在线商店:Shop National Geographic
2018/06/30 全球购物
经理秘书找工作求职信
2013/12/19 职场文书
好邻里事迹材料
2014/01/16 职场文书
小学科学教学反思
2014/01/26 职场文书
招商专员岗位职责
2014/02/08 职场文书
个人自荐材料
2014/05/23 职场文书
人力资源管理专业自荐书
2014/07/07 职场文书
2014年保安个人工作总结
2014/11/13 职场文书
劳模事迹材料范文
2014/12/24 职场文书
2016年教师节贺卡寄语
2015/12/04 职场文书
基于Python和openCV实现图像的全景拼接详细步骤
2021/10/05 Python
vue 给数组添加新对象并赋值
2022/04/20 Vue.js