广州市品高软件股份有限公司3月招聘面试题115道2020311

在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


广州市品高软件股份有限公司3月招聘面试题面试题面试官常问到的一些题目整理如下:问题 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:什么是Python pass?可用的回答 :pass意味着,无操作的Python语句,或者换句话说,它是复合语句中的占位符,其中应该留有空白,并且不必在那里写入任何内容。问题 Q3:Python中的docstring是什么?可用的回答 :Python文档字符串称为docstring,它是一种记录Python函数,模块和类的方法。可以通过内置方法_doc_获取问题 Q4:简述一下scrapy的基本流程?可用的回答 : scrapy分为9个步骤: 1. Spiders需要初始的start_url或则函数stsrt_requests,会在内部生成Requests给Engine; 2. Engine将requests发送给Scheduler; 3. Engine从Scheduler那获取requests,交给Download下载; 4. 在交给Dowmload过程中会经过Downloader Middlewares(经过process_request函数); 5. Dowmloader下载页面后生成一个response,这个response会传给Engine,这个过程中又经过了Downloader Middlerwares(经过process_request函数),在传送中出错的话经过process_exception函数; 6. Engine将从Downloader那传送过来的response发送给Spiders处理,这个过程经过Spiders Middlerwares(经过process_spider_input函数); 7. Spiders处理这个response,返回Requests或者Item两个类型,传给Engine,这个过程又经过Spiders Middlewares(经过porcess_spider_output函数); 8. Engine接收返回的信息,如果使Item,将它传给Items Pipeline中;如果是Requests,将它传给Scheduler,继续爬虫; 9. 重复第三步,直至没有任何需要爬取的数据 问题 Q5:迭代器和生成器的区别?可用的回答 : 1)迭代器是一个更抽象的概念,任何对象,如果它的类有next方法和iter方法返回自己本身。对于 string、list、dict、tuple等这类容器对象,使用for循环遍历是很方便的。在后台for语句对容器对象调 用iter()函数,iter()是python的内置函数。iter()会返回一个定义了next()方法的迭代器对象,它在容器中 逐个访问容器内元素,next()也是python的内置函数。在没有后续元素时,next()会抛出一个 StopIteration异常 2)生成器(Generator)是创建迭代器的简单而强大的工具。它们写起来就像是正规的函数,只是在需 要返回数据的时候使用yield语句。每次next()被调用时,生成器会返回它脱离的位置(它记忆语句最后 一次执行的位置和所有的数据值) 区别:生成器能做到迭代器能做的所有事,而且因为自动创建了iter()和next()方法,生成器显得特别简洁, 而且生成器也是高效的,使用生成器表达式取代列表解析可以同时节省内存。除了创建和保存程序状态 的自动方法,当发生器终结时,还会自动抛出StopIteration异常 问题 Q6:什么又是yield from呢?可用的回答 :简单地说,yield from generator 。实际上就是返回另外一个生成器。问题 Q7:如果对方网站反爬取,封IP了怎么办?可用的回答 : 放慢抓取熟速度,减小对目标网站造成的压力,但是这样会减少单位时间内的数据抓取量 使用代理IP(免费的可能不稳定,收费的可能不划算) 问题 Q8: scrapy的优缺点?为什么要选择scrapy框架?可用的回答 : 优点: 采取可读性更强的xpath代替正则强大的统计和log系统 同时在不同的url上爬行 支持shell方式,方便独立调试 写middleware,方便写一些统一的过滤器 通过管道的方式存入数据库 缺点: 基于python爬虫框架,扩展性比较差,基于twisted框架, 运行中exception是不会干掉reactor,并且异步框架出错后是不会停掉其他任务的,数据出错后难以察觉 问题 Q9:Python中的lambda是什么?可用的回答 :它是一个单独的表达式匿名函数,通常用作内联函数。问题 Q10:Python里面match()和search()的区别?可用的回答 :re模块中match(pattern,string,flags),检查string的开头是否与pattern匹配。re模块中research(pattern,string,flags),在string搜索pattern的第一个匹配值。算法题面试官常问到的一些算法题目整

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

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特性(例如外键)的表不适用。

更多 “广州市品高软件股份有限公司3月招聘面试题115道2020311” 相关考题
考题 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

考题 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

考题 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

考题 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

考题 You want to start monitoring statistics on the distribution of storage engines that are being used and the average sizes of tables in the various databases. Some details are as follows: The Mysql instance has 400 databases. Each database on an average consists of 25-50 tables. You use the query: SELECT TABLE_SCHEMA, 'ENGINE', COUNT (*), SUM(data_length) total_size FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE= 'BASE TABLE' GROUP BY TABLE_SCHEMA, 'ENGINE' ; Why is this query slow to execute?()A、Collecting information requires large numbers of locks on various INFORMATION_SCHEMA tablesB、Aggregating details from various storage engine caches for the final output is time consumingC、Collecting information requires various disk-level operations and is time consumingD、Counting and summarizing all table pages in the InnoDB shared tablespace is time consuming正确答案:C

考题 多选题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解析:暂无解析

考题 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

考题 关于myisamchk工具,以下描述正确的有哪些?()A、它能检查MyISAM表B、它能修复MyISAM表C、它能获取MyISAM表的信息D、它能优化MyISAM表正确答案:A,B,C,D

考题 多选题关于myisamchk工具,以下描述正确的有哪些?()A它能检查MyISAM表B它能修复MyISAM表C它能获取MyISAM表的信息D它能优化MyISAM表正确答案:C,A解析:暂无解析

考题 多选题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解析:暂无解析