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

面试题 相关文章推荐
如何在Cookie里面保存Unicode和国际化字符
May 25 面试题
Java里面如何把一个Array数组转换成Collection, List
Jul 26 面试题
中软Java笔试题
Nov 11 面试题
在Java开发中如何选择使用哪种集合类
Aug 09 面试题
2019年Java 最常见的 面试题
Oct 19 面试题
C语言笔试题
Sep 04 面试题
编程实现当输入某产品代码则打印出该产品记录的功能
May 03 面试题
为什么在使用动态 SQL 语句时必须为低层数据库对象授予权限
Dec 13 面试题
视图的作用
Dec 19 面试题
亿阳信通股份有限公司笔试题(C#)
Mar 04 面试题
this关键字的含义
Apr 08 面试题
EntityManager都有哪些方法
Nov 01 面试题
遇到的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网站)
2015/10/20 PHP
jquery 获取自定义属性(attr和prop)的实现代码
2012/06/27 Javascript
基于KMP算法JavaScript的实现方法分析
2013/05/03 Javascript
jQuery学习笔记之jQuery原型属性和方法
2014/06/09 Javascript
javascript中声明函数的方法及调用函数的返回值
2014/07/22 Javascript
Yii2使用Bootbox插件实现自定义弹窗
2015/04/02 Javascript
3种js实现string的substring方法
2015/11/09 Javascript
如何利用Promises编写更优雅的JavaScript代码
2016/05/17 Javascript
jQuery中的一些常见方法小结(推荐)
2016/06/13 Javascript
使用BootStrapValidator完成前端输入验证
2016/09/28 Javascript
学习JavaScript图片预加载模块
2016/11/07 Javascript
javascript判断firebug是否开启的方法
2016/11/23 Javascript
JS作用域闭包、预解释和this关键字综合实例解析
2016/12/16 Javascript
Python 编码Basic Auth使用方法简单实例
2017/05/25 Python
Python实现的用户登录系统功能示例
2018/02/05 Python
python3.7 sys模块的具体使用
2019/07/22 Python
python中with语句结合上下文管理器操作详解
2019/12/19 Python
pycharm快捷键汇总
2020/02/14 Python
python topk()函数求最大和最小值实例
2020/04/02 Python
python操作yaml说明
2020/04/08 Python
iPython pylab模式启动方式
2020/04/24 Python
tensorflow dataset.shuffle、dataset.batch、dataset.repeat顺序区别详解
2020/06/03 Python
Python pip安装第三方库实现过程解析
2020/07/09 Python
python实现图像随机裁剪的示例代码
2020/12/10 Python
JPA面试常见问题
2016/11/14 面试题
光声世纪笔试题目
2012/08/25 面试题
Prototype如何为一个Ajax添加一个参数
2015/12/06 面试题
北大研究生linux应用求职信
2013/10/29 职场文书
节电标语大全
2014/06/23 职场文书
大型主题婚礼活动策划方案
2014/09/15 职场文书
领导四风问题整改措施思想汇报
2014/10/13 职场文书
会计岗位职责范本
2015/04/02 职场文书
2015年法律事务部工作总结
2015/07/27 职场文书
Pandas||过滤缺失数据||pd.dropna()函数的用法说明
2021/05/14 Python
详细了解MVC+proxy
2021/07/09 Java/Android
带你了解CSS基础知识,样式
2021/07/21 HTML / CSS