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

面试题 相关文章推荐
Java的基础面试题附答案
Jan 10 面试题
金蝶的一道SQL笔试题
Dec 18 面试题
ORACLE十问
Apr 20 面试题
命名空间(namespace)和程序集(Assembly)有什么区别
Sep 25 面试题
诺思信科技(南京)有限公司.NET笔试题答案
Jul 06 面试题
什么是跨站脚本攻击
Dec 11 面试题
维德科技C#面试题笔试题
Dec 09 面试题
linux面试题参考答案(1)
Jan 22 面试题
如何利用cmp命令比较文件
Sep 23 面试题
ajax是什么及其工作原理
Feb 08 面试题
编程用JAVA解析XML的方式
Jul 07 面试题
shell的种类有哪些
Apr 15 面试题
遇到的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中的foreach函数
2013/08/31 PHP
php结合安卓客户端实现查询交互实例
2015/05/05 PHP
javascript 写类方式之一
2009/07/05 Javascript
JS 事件绑定函数代码
2010/04/28 Javascript
div模拟选择框示例代码
2013/11/03 Javascript
js实现双击图片放大单击缩小的方法
2015/02/17 Javascript
JavaScript实现横向滑出的多级菜单效果
2015/10/09 Javascript
JavaScript小技巧整理
2015/12/30 Javascript
微信小程序 form组件详解
2016/10/25 Javascript
react-router v4如何使用history控制路由跳转详解
2018/01/09 Javascript
javascript设计模式 ? 工厂模式原理与应用实例分析
2020/04/09 Javascript
python基础教程之常用运算符
2014/08/29 Python
python以环状形式组合排列图片并输出的方法
2015/03/17 Python
python中循环语句while用法实例
2015/05/16 Python
python使用SMTP发送qq或sina邮件
2017/10/21 Python
Python爬虫通过替换http request header来欺骗浏览器实现登录功能
2018/01/07 Python
Python实现PS滤镜Fish lens图像扭曲效果示例
2018/01/29 Python
Python数据分析之获取双色球历史信息的方法示例
2018/02/03 Python
python高效过滤出文件夹下指定文件名结尾的文件实例
2018/10/21 Python
浅谈python中拼接路径os.path.join斜杠的问题
2018/10/23 Python
python实现雪花飘落效果实例讲解
2019/06/18 Python
python实现文件批量编码转换及注意事项
2019/10/14 Python
python matplotlib拟合直线的实现
2019/11/19 Python
Python实现微信好友的数据分析
2019/12/16 Python
全球高级音频和视频专家:HiDef Lifestyle
2019/08/02 全球购物
《和田的维吾尔》教学反思
2014/04/14 职场文书
巾帼文明岗申报材料
2014/05/01 职场文书
商业项目策划方案
2014/06/05 职场文书
奥林匹克的口号
2014/06/13 职场文书
员工试用期自我评价
2014/09/18 职场文书
走群众路线剖析材料
2014/10/09 职场文书
学生会辞职信
2015/03/02 职场文书
毕业生学校组织意见
2015/06/04 职场文书
法人身份证明书
2015/06/18 职场文书
pytorch 如何使用float64训练
2021/05/24 Python
Java Spring Boot请求方式与请求映射过程分析
2022/06/25 Java/Android