安徽皖通科技股份有限公司5月招聘面试题158道2020516

在MySQL数据库中,对作为临时存放查询的中间结果集的存储引擎描述正确的是()。

A.始终使用Memory作为临时存放查询的中间结果集

B.默认使用InnoDB作为临时存放查询的中间结果集

C.如果中间结果集含有TEXT或BLOB列的类型字段,则MySQL数据库会将其转换到MylSAM存储引擎表而存放到磁盘中

D.默认使用MylSAM作为临时存放查询的中间结果集


正确答案:B


Which three are properties of the MyISAM storage engine?()

A.Transaction support

B.FULLTEXT indexing for text matching

C.Table and page level locking support

D.Foreign key support

E.Geospatial indexing

F.HASH index support

G.Table level locking only


参考答案:B, E, G


What is true regarding InnoDB locking?()

A.InnoDB uses row and table-level locks, but row locks are not escalates

B.InnoDB locks only those rows that are updated

C.InnoDB only uses row locks, not page or table-level locks

D.InnoDB row locks may be escalated to page or table-level locks

E.InnoDB uses row-level or table-level locks depending on the number of rows affected


参考答案:B


The InnoDB engine has a feature known as clustered indexes.Which three statements are true about clustered indexes as used in InnoDB?()

A.A primary key must exist for creation of a clustered index

B.A clustered index allows fulltext searching within InnoDB

C.The first unique index is always used as a clustered index and not a primary key

D.A clustered index provides direct access to a page containing row data

E.If no indexes exist, a hidden clustered index is generated based on row IDs

F.A primary key is used as a clustered index

G.A clustered index is a grouping of indexes from different tables into a global index for faster searching


参考答案:D, E, F


Which two statements are true about InnoDB auto-increment locking?()

A.The auto-increment lock can be a table-level lock

B.InnoDB never uses table-level locks

C.Some settings for innodb_autoinc_lock_mode can help reduce locking

D.InnoDB always protects auto-increment updates with a table-level lock


参考答案:A, C


安徽皖通科技股份有限公司5月招聘面试题面试题面试官常问到的一些题目整理如下:问题 Q1:你常用的mysql引擎有哪些?各引擎间有什么区别?可用的回答 : 主要 MyISAM 与 InnoDB 两个引擎,其主要区别如下: 一、 InnoDB 支持事务,MyISAM 不支持,这一点是非常之重要。 事务是一种高级的处理方式,如在一些列增删改中只要哪个出错还可以回滚还原,而 MyISAM就不可以了; 二、 MyISAM 适合查询以及插入为主的应用,InnoDB 适合频繁修改以及涉及到安全性较高的应用; 三、 InnoDB 支持外键,MyISAM 不支持; 四、 MyISAM 是默认引擎,InnoDB 需要指定; 五、 InnoDB 不支持 FULLTEXT 类型的索引; 六、 InnoDB 中不保存表的行数,如 select count(*) from table 时,InnoDB; 需要扫描一遍整个表来计算有多少行,但是 MyISAM 只要简单的读出保存好的行数即可。 注意的是,当 count(*)语句包含 where 条件时 MyISAM 也需要扫描整个表; 七、 对于自增长的字段,InnoDB 中必须包含只有该字段的索引,但是在 MyISAM 表中可以和其他字段一起建立联合索引; 八、 清空整个表时,InnoDB 是一行一行的删除,效率非常慢。MyISAM 则会重建表; 九、 InnoDB 支持行锁(某些情况下还是锁整表,如 update table set a=1 where user like %lee% 问题 Q2:你对Django的认识?可用的回答 : Django是走大而全的方向,它最出名的是其全自动化的管理后台:只需要使用起ORM,做简单的对象定义,它就能自动生成数据库结构、以及全功能的管理后台。 Django内置的ORM跟框架内的其他模块耦合程度高。 应用程序必须使用Django内置的ORM,否则就不能享受到框架内提供的种种基于其ORM的便利; 理论上可以切换掉其ORM模块,但这就相当于要把装修完毕的房子拆除重新装修,倒不如一开始就去毛胚房做全新的装修。 Django的卖点是超高的开发效率,其性能扩展有限;采用Django的项目,在流量达到一定规模后,都需要对其进行重构,才能满足性能的要求。 Django适用的是中小型的网站,或者是作为大型网站快速实现产品雏形的工具。 Django模板的设计哲学是彻底的将代码、样式分离; Django从根本上杜绝在模板中进行编码、处理数据的可能。 问题 Q3:介绍一下except的用法和作用?可用的回答 : tryexceptexceptelsefinally 执行try下的语句,如果引发异常,则执行过程会跳到except语句。 对每个except分支顺序尝试执行,如果引发的异常与except中的异常组匹配,执行相应的语句。 如果所有的except都不匹配,则异常会传递到下一个调用本代码的最高层try代码中。 try下的语句正常执行,则执行else块代码。如果发生异常,就不会执行 如果存在finally语句,最后总是会执行。 问题 Q4:如果对方网站反爬取,封IP了怎么办?可用的回答 : 放慢抓取熟速度,减小对目标网站造成的压力,但是这样会减少单位时间内的数据抓取量 使用代理IP(免费的可能不稳定,收费的可能不划算) 问题 Q5:有哪些工具可以帮助查找错误或执行静态分析?可用的回答 : PyChecker是一个静态分析工具,可以检测Python源代码中的错误,并警告错误的风格和复杂性。 Pylint是另一种验证模块是否符合编码标准的工具。 auto-pep8工具也可以进行静态代码检查 问题 Q6:遇到过得反爬虫策略以及解决方法?可用的回答 : 反爬虫策略: 1.通过headers反爬虫 2.基于用户行为的发爬虫(同一IP短时间内访问的频率,封IP) 3.动态网页反爬虫(通过ajax请求数据,或者通过JavaScript生成) 4.对部分数据进行加密处理的(数据是乱码) 解决方法: 1. 对于基本网页的抓取可以自定义headers,添加headers的数据 2. 使用多个代理ip进行抓取或者设置抓取的频率降低一些, 3. 动态网页的可以使用selenium + phantomjs 进行抓取 4. 对部分数据进行加密的,可以使用selenium进行截图,使用python自带的pytesseract库进行识别,但是比较慢最直接的方法是找到加密的方法进行逆向推理。 问题 Q7:如何删除python数组的值?可用的回答 :可以使用pop()或remove()方法删除数组元素。这两个函数之间的区别在于前者返回已删除的值,而后者则不返回。问题 Q8:谷歌的无头浏览器?可用的回答 : 无头浏览器即headless browser,是一种没有界面的浏览器。既然是浏览器那么浏览器该有的东西它都应该有,只是看不到界面而已。 Python中selenium模块中的PhantomJS即为无界面浏览器(无头浏览器):是基于QtWebkit的无头浏览器。 问题 Q9:描述数组、链表、队列、堆栈的区别?可用的回答 : 数组与链表是数据存储方式的概念,数组在连续的空间中存储数据,而链表可以在非连续的空间中存储数据; 队列和堆栈是描述数据存取方式的概念,队列是先进先出,而堆栈是后进先出; 队列和堆栈可以用数组来实现,也可以用链表实现。 问题 Q10:什么是C/S和B/S架构?可用的回答 : 1. C/S架构及其背景 C/S架构是一种比较早的软件架构,主要应用于局域网内。在这之前经历了集中计算模式,随着计算机网络的进步与发展,尤其是可视化工具的应用,出现过两层C/S和三层C/S架构, 不过一直很流行也比较经典的是我们所要研究的两层C/S架构。 C/S架构软件(即客户机/服务器模式)分为客户机和服务器两层: 第一层是在客户机系统上结合了表示与业务逻辑, 第二层是通过网络结合了数据库服务器。 简单的说就是第一层是用户表示层,第二层是数据库层。 客户端

关于常见的存储引擎,下面描述错误的是_____________。

A.InnoDB存储引擎虽然不支持事件处理应用程序,但是支持外键、同时还支持崩溃修复能力和并发控制

B.MEMORY存储引擎的所有数据都存储在内存中,数据的处理速度快但安全性不高

C.MyISAM存储引擎提供了高速的存储与检索和全文探索能力,它并不支持事务处理应用程序

D.除了InnoDB、MOMORY和MyISAM存储引擎外,MRG_MYISAM、BLACKHOLE和CSV也是MySQL数据库的存储引擎


参考答案:A


在Mysql数据库下,以下哪个选项最好地描述了InnoDB表为什么需要主键并且主键应当尽量短?()

A.因为InnoDB在一个日志中保存到所有主键的指针,短的主键使日志小

B.因为InnoDB使用主键定位二级索引,短的主键使查询快

C.因为InnoDB使用主键定位表记录,短的主键使查询快

D.因为InnoDB使用主键定位表,短的主键使查询快


参考答案:C


关于myisamchk工具,以下描述正确的有哪些?()

A.它能检查MyISAM表

B.它能修复MyISAM表

C.它能获取MyISAM表的信息

D.它能优化MyISAM表


参考答案:ABCD


mysql 参照表和被参照表可以是同一个表吗?

长久以来,流行工具开源RDBMSMySQL并没有支持外键,最近MySQL的不同版本都通过新InnoDB列表引擎支持外键。为了建立两个MySQL表之间的一个外键关系,MySQL创建关联表必须满足以下三种情况:

* 两个表必须是InnoDB表类型。 

* 使用在外键关系的域必须为索引型(Index)。 

* 使用在外键关系的域必须与数据类型相似。


例子.

CREATE TABLE  DEPT (
  id  INT  PRIMARY KEY,
  name  varchar(10),
  pid INT
) ENGINE=InnoDB ;


ALTER TABLE DEPT
   ADD CONSTRAINT DEPT_cons
   FOREIGN KEY (pid)
   REFERENCES  DEPT(id);

下面是插入数据的结果.

mysql> INSERT INTO DEPT VALUES(1, '总公司', NULL);
Query OK, 1 row affected (0.04 sec)

mysql> INSERT INTO DEPT VALUES(2, '分公司', 1);
Query OK, 1 row affected (0.11 sec)

mysql> INSERT INTO DEPT VALUES(3, '办事处', 2);
Query OK, 1 row affected (0.08 sec)

mysql>
mysql> INSERT INTO DEPT VALUES(4, '非法数据', 5);
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`test`.`dept`,
CONSTRAINT `DEPT_cons` FOREIGN KEY (`pid`) REFERENCES `dept` (`id`))
mysql>

希望能帮到你,别忘了采纳我的答案哦,祝你生活愉快!



简述MyISAM与innoDB存储引擎有何差别?


正确答案: A.两者在文件构成上有区别;
B.InnoDB支持事务处理,MyISAM不支持;
C.对无WHERE子句的COUNT(*)操作的不同:MyISAM中保存了该值,直接读取,InnoDB需要作全表扫描;
D.锁的区别:InnoDB支持表级锁和行级锁,MyISAM只支持表级锁;
E.索引会缓存数据,而MYISAM不会;
F.INNODB不区分char和varchar;
G.INNODB支持hash索引,而MYISAM不支持;
H.InnoDB不支持FULLTEXT类型的索引;
I.InnoDB 中不保存表的具体行数,也就是说,执行select count(*) from table时,InnoDB要扫描一遍整个表来计算有多少行,但是MyISAM只要简单的读出保存好的行数即可。注意的是,当count(*)语句包含
W.here条件时,两种表的操作是一样的;
J.对于AUTO_INCREMENT类型的字段,InnoDB中必须包含只有该字段的索引,但是在MyISAM表中,可以和其他字段一起建立联合索引;
K.DELETE FROM table时,InnoDB不会重新建立表,而是一行一行的删除;
L.LOAD TABLE FROM
M.ASTER操作对InnoDB是不起作用的,解决方法是首先把InnoDB表改成MyISAM表,导入数据后再改成InnoDB表,但是对于使用的额外的InnoDB特性(例如外键)的表不适用。

更多 “安徽皖通科技股份有限公司5月招聘面试题158道2020516” 相关考题
考题 The InnoDB engine has a feature known as clustered indexes. Which three statements are true about clustered indexes as used in InnoDB?()A、A primary key must exist for creation of a clustered indexB、A clustered index allows fulltext searching within InnoDBC、The first unique index is always used as a clustered index and not a primary keyD、A clustered index provides direct access to a page containing row dataE、If no indexes exist, a hidden clustered index is generated based on row IDsF、A primary key is used as a clustered indexG、A clustered index is a grouping of indexes from different tables into a global index for faster searching正确答案:D,E,F

考题 Full Atomicity, Consistency, Isolation, Durability (ACID) compliance is a necessity for a new application, which heavily reads and writes data. This requires the following config file options: Sync_binlog=1 Innodb_flush_log_at_trx_commit=1 Innodb_doublewrite=1 However, this configuration is expected to introduce disk I/O overhead. What three changes will reduce disk I/O overheads?()A、Use of soft links for database directories on the same physical diskB、Use of delay_key_write=ON for batch index updateC、Allocation of RAM to the buffer pool such that more of the data can fit in RAMD、Placement of InnoDB log files and datadir on separate physical disksE、Use of separate directories on the same physical disk for log files and data files正确答案:B,C,D

考题 Which two statements are true about InnoDB auto-increment locking?()A、The auto-increment lock can be a table-level lockB、InnoDB never uses table-level locksC、Some settings for innodb_autoinc_lock_mode can help reduce lockingD、InnoDB always protects auto-increment updates with a table-level lock正确答案:A,C

考题 Following a server crash, the automatic recovery of InnoDB fails. How would you begin to manually repair the InnoDB tables?()A、Start the server with the – innodb_recover_options option set to FORCEB、Start the server with the – innodb_force_recovery option set to a non-zero valueC、Start the server as usual, and then execute the REPAIR TABLE commandD、Start the server as usual, and then execute the CHECK TABLE command正确答案:B

考题 You have table 'apps','userdata' on server that uses MyISAM storage engine. You want to transfer this data to server but use InnoDB engine instead. You execute the following commands: ServerB commands: Shell> mysqldump –u root –h server –no-data apps userdata | mysql –u root –p apps Shell> mysql –u root –p –h server –e 'ALTER TABLE 'apps','userdata' ENGINE=InnoDB;' Shell> mysqldump –u root –p –h server –no-create-info –order-by-primary apps userdata | mysql –u root –p apps What effect does the – order-by-primary argument have on the mysqldump command?()A、It exports tables with the most indexes first to assist with import speedsB、It ensures that unique indexes have no conflicts when the data is dumpedC、It orders by primary key to assist in speeding up importing to InnoDB tablesD、It must be specified so index data is dumped correctly when –on-create-info is used正确答案:C

考题 What is true regarding InnoDB locking?()A、InnoDB uses row and table-level locks, but row locks are not escalatesB、InnoDB locks only those rows that are updatedC、InnoDB only uses row locks, not page or table-level locksD、InnoDB row locks may be escalated to page or table-level locksE、InnoDB uses row-level or table-level locks depending on the number of rows affected正确答案:B

考题 多选题Which three statements are true about memory buffer allocation by a MySQL Server?()AGlobal buffers such as the InnoDB buffer pool are allocated after the server starts, and are never freedBThread buffers are allocated when a client connects, and are freed when the client disconnectsCBuffers that are needed for certain operation are allocated when the operation starts, and freed when it endsDUser buffers are allocated at server startup and freed when the user is droppedEAll dynamic buffers that are set with a SET GLOBAL statement immediately get allocated globally, and are never freed正确答案:A,B解析:暂无解析

考题 多选题What are two methods of taking a binary backup of a Mysql Server using InnoDB storage engine?()AFile system snapshotsBMysqldumpslowCMysqlhotcopyDMysqldump with – binary-data optionEMysql Enterprise Backup正确答案:C,B解析:暂无解析

考题 多选题Full Atomicity, Consistency, Isolation, Durability (ACID) compliance is a necessity for a new application, which heavily reads and writes data. This requires the following config file options: Sync_binlog=1 Innodb_flush_log_at_trx_commit=1 Innodb_doublewrite=1 However, this configuration is expected to introduce disk I/O overhead. What three changes will reduce disk I/O overheads?()AUse of soft links for database directories on the same physical diskBUse of delay_key_write=ON for batch index updateCAllocation of RAM to the buffer pool such that more of the data can fit in RAMDPlacement of InnoDB log files and datadir on separate physical disksEUse of separate directories on the same physical disk for log files and data files正确答案:D,E解析:暂无解析

考题 Which three are properties of the MyISAM storage engine?()A、Transaction supportB、FULLTEXT indexing for text matchingC、Table and page level locking supportD、Foreign key supportE、Geospatial indexingF、HASH index supportG、Table level locking only正确答案:B,E,G