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

面试题 相关文章推荐
error和exception有什么区别
Oct 02 面试题
写出二分查找算法的两种实现
May 13 面试题
介绍一下内联、左联、右联
Dec 31 面试题
深圳-东方伟业笔试部分
Feb 11 面试题
一套C#面试题
Oct 09 面试题
四川internet信息高速公路(C#)笔试题
Feb 29 面试题
linux面试题参考答案(9)
Jan 07 面试题
什么是Linux虚拟文件系统VFS
Aug 25 面试题
系统管理员的职责包括那些?管理的对象是什么?
Sep 20 面试题
什么是SCM(软件配置管理)
Aug 16 面试题
传统软件工程与面向对象的软件工程有什么区别
May 31 面试题
如何利用XMLHTTP检测URL及探测服务器信息
Nov 10 面试题
遇到的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 mail 通过Windows的SMTP发送邮件失败的解决方案
2009/05/27 PHP
php截取utf-8中文字符串乱码的解决方法
2010/03/29 PHP
PHP的SQL注入过程分析
2012/01/06 PHP
php set_time_limit()函数的使用详解
2013/06/05 PHP
解决PHP mysql_query执行超时(Fatal error: Maximum execution time …)
2013/07/03 PHP
PHP和javascript常用正则表达式及用法实例
2014/07/01 PHP
phpcms的分类名称和类别名称的调用
2017/01/05 PHP
Laravel使用RabbitMQ的方法示例
2019/06/18 PHP
PHP框架实现WebSocket在线聊天通讯系统
2019/11/21 PHP
Javascript MD4
2006/12/20 Javascript
JQuery EasyUI 对话框的使用方法
2010/10/24 Javascript
javascript设置金额样式转换保留两位小数示例代码
2013/12/04 Javascript
node.js中的console.warn方法使用说明
2014/12/09 Javascript
javascript删除数组重复元素的方法汇总
2015/06/24 Javascript
js滑动提示效果代码分享
2016/03/10 Javascript
Angular2内置指令NgFor和NgIf详解
2016/08/03 Javascript
jQuery中Find选择器用法示例
2016/09/21 Javascript
jQuery事件详解
2017/02/23 Javascript
vue.js实现价格格式化的方法
2017/05/23 Javascript
electron demo项目npm install安装失败的解决方法
2018/02/06 Javascript
vue权限路由实现的方法示例总结
2018/07/29 Javascript
详解vue 组件
2020/06/11 Javascript
python对json的相关操作实例详解
2017/01/04 Python
python实现将一维列表转换为多维列表(numpy+reshape)
2019/11/29 Python
Python 实现使用空值进行赋值 None
2020/03/12 Python
浅谈Python中的继承
2020/06/19 Python
超级实用的8个Python列表技巧
2020/08/24 Python
美国现代家具网站:Design Within Reach
2018/07/19 全球购物
Java面试题:为什么要用Java
2012/05/11 面试题
公务员职业生涯规划书范文  
2014/01/19 职场文书
大学运动会通讯稿
2014/01/28 职场文书
2014年乡镇人大工作总结
2014/11/25 职场文书
浅谈sql_@SelectProvider及使用注意说明
2021/08/04 Java/Android
Nginx实现会话保持的两种方式
2022/03/18 Servers
我的收音机情缘
2022/04/05 无线电
Java实现注册登录跳转
2022/06/16 Java/Android