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

面试题 相关文章推荐
PHP面试题及答案二
May 23 面试题
JRE、JDK、JVM之间的关系怎样
May 16 面试题
联强国际笔试题面试题
Jul 10 面试题
C++如何引用一个已经定义过的全局变量
Aug 25 面试题
编写一子程序,将一链表倒序,即使链表表尾变表头,表头变表尾
Feb 10 面试题
将一个文本文件的内容按倒序打印出来
Jan 05 面试题
经典C++面试题一
Nov 06 面试题
阿里巴巴Oracle DBA笔试题答案-备份恢复类
Nov 20 面试题
linux面试题参考答案(5)
Nov 05 面试题
Java文件和目录(IO)操作
Aug 26 面试题
JPA的优势都有哪些
Jul 04 面试题
如何安装ruby on rails
Feb 09 面试题
遇到的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的FTP学习(四)
2006/10/09 PHP
PHP抽象类 介绍
2012/06/13 PHP
php对数组排序的简单实例
2013/12/25 PHP
PHP常用字符串操作函数实例总结(trim、nl2br、addcslashes、uudecode、md5等)
2016/01/09 PHP
浅谈PHP中如何实现Hook机制
2017/11/14 PHP
Laravel框架路由和控制器的绑定操作方法
2018/06/12 PHP
php防止表单重复提交实例讲解
2019/02/11 PHP
始终在屏幕中间显示Div的代码(css+js)
2011/03/10 Javascript
理清apply(),call()的区别和关系
2011/08/14 Javascript
Jquery 类网页微信二维码图块滚动效果具体实现
2013/10/14 Javascript
bootstrap学习笔记之初识bootstrap
2016/06/21 Javascript
Vue中使用vux的配置详解
2017/05/05 Javascript
bootstrap timepicker在angular中取值并转化为时间戳
2017/06/13 Javascript
Thinkphp5微信小程序获取用户信息接口的实例详解
2017/09/26 Javascript
浅谈es6中export和export default的作用及区别
2018/02/07 Javascript
Express进阶之log4js实用入门指南
2018/02/10 Javascript
vue解决一个方法同时发送多个请求的问题
2018/09/25 Javascript
js实现input密码框显示/隐藏功能
2020/09/10 Javascript
Vue 引入AMap高德地图的实现代码
2019/04/29 Javascript
js核心基础之构造函数constructor用法实例分析
2019/05/11 Javascript
vue输入框使用模糊搜索功能的实现代码
2020/05/26 Javascript
Python机器学习之决策树算法
2017/12/22 Python
解决Django的request.POST获取不到内容的问题
2018/05/28 Python
Python模拟登录的多种方法(四种)
2018/06/01 Python
python绘制圆柱体的方法
2018/07/02 Python
CSS3实现缺角矩形,折角矩形以及缺角边框
2019/12/20 HTML / CSS
Europcar西班牙:全球汽车租赁领域的领导者
2018/09/17 全球购物
婴儿鞋,独特的婴儿服装和配件:Zutano
2018/11/03 全球购物
英国最受信任的在线眼镜商之一:Fashion Eyewear
2019/10/31 全球购物
美国户外烹饪产品购物网站:Outdoor Cooking
2020/01/10 全球购物
酒店总经理工作职责
2013/12/13 职场文书
优秀团员自我评价范文
2014/04/23 职场文书
行政专员求职信范文
2014/05/03 职场文书
2015年十一国庆节演讲稿
2015/03/20 职场文书
《家庭教育》读后感3篇
2019/12/18 职场文书
深入理解go slice结构
2021/09/15 Golang