由于最近工作比较忙,答案会抽空更新。希望可以与大家共同学习、探讨、共同进步。
1.MySQL中,使用正则表达式查找news表中title以S或Q或L字母结尾的所有数据,语句是?
A. SELECT * FROM news WHERE title REGEXP '^sql';
B. SELECT * FROM news WHERE title REGEXP '(S|Q|L)$';
C. SELECT * FROM news WHERE title REGEXP 'mysql$';
D. SELECT * FROM news WHERE title REGEXP '^mysql';
2.MySQL的回滚事务的关键字是?
A. rollback
B. runback
C. rallback
D. rqllback
3.如何修改MySQL的最大连接数量1000?
A. max_connections = 1000
B. max_sql_connections = 1000
C. max_mysql_connections = 1000
D. connections = 1000
4.MySQL创建临时表的命令是?
A. CREATE TEMPORARY TABLE 表名
B. CREATE TABLE 表名 (列)
C. CREATE TABLE 表名 (列定义)
D. CREATE TEMPORARY TABLE 表名 (列定义)
5.JDBC中,可以使用哪个对象来防止SQL注入?
A. Statement
B. SQLStatement
C. PreparedStatement
D. MySQLStatement
6.MySQL设置Innodb存储引擎的命令?
A. CHANGE TABLE my_table ENGINE = InnoDB;
B. ALTER TABLE my_table ENGINE = InnoDB;
C. ALTER ENGINE = InnoDB;
D. CHANGE ENGINE = InnoDB;
7. 如何开启MySQL的慢查询日志功能?
A. 配置文件中设置slow_query=1
B. 配置文件中设置query_log=1
C. 配置文件中设置slow_query_log=1
D. 配置文件中设置slow_query=true
8.MySQL中,使用正则表达式查找news表中title以S或Q或L字母开头的所有数据,语句是?
A. SELECT * FROM news WHERE title like '^sql';
B. SELECT * FROM news WHERE title REGEXP '^sql';
C. SELECT * FROM news WHERE title REGEXP '^(S|Q|L)';
D. SELECT * FROM news WHERE title REGEXP 'mysql$';
9.MySQL如何设置默认的事务隔离级别?
A. 配置文件mysql.cnf中修改transaction_isolation = READ-COMMITTED
B. 配置文件mysql.txt中修改transaction_isolation = READ-COMMITTED
C. 配置文件mysql.config中修改transaction_isolation = READ-COMMITTED
D. 配置文件mysql.bin中修改transaction_isolation = READ-COMMITTED
10.MySQL如何修改日志文件的位置?
A. mysql.cnf中修改log-error=/var/log/mysqld.log
B. mysql.txt中修改log-error=/var/log/mysqld.log
C. mysql.config中修改log-error=/var/log/mysqld.log
D. mysql.cnf中修改log-error=/var/log/my.log
11.MySQL如何innnodb控制锁lock的超时时间?
A. innodbwait_timeout = 30
B. lock_wait_timeout = 30
C. wait_timeout = 30
D. innodb_lock_wait_timeout = 30
12.使用SQL命令如何查看当前MySQL的状态?
A. SHOW STATUS
B. SHOW STATUS( )
C. SELECT STATUS
D. SELECT STATUS( )
13.Clustered Index和NoClustered Index的区别是?
A. Clustered Index影响表大小
B. Clustered Index影响数据的物理存储顺序
C. NoClustered Index影响表大小
D. NoClustered Index影响数据的物理存储顺序
14.如何配置MySQL InnnoDB引擎的读线程数量?
A. innodb_write_io_threads = 8
B. innodb_read_io_threads = 4
C. write_io_threads = 8
D. read_io_threads = 4
14.如何配置MySQL InnnoDB引擎的写线程数量?
A. innodb_write_io_threads = 8
B. innodb_read_io_threads = 4
C. write_io_threads = 8
D. read_io_threads = 4
15.mysql binlog日志文件保存的过期时间10天?
A. logs_days = 10
B. expire_logs = 10
C. expire_days = 10
D. expire_logs_days = 10
16.MySQL查询缓存机制query_cache_size的目的是?
A. 缓存查询计划,节约磁盘空间
B. 缓存查询计划,提升查询性能
C. 缓存查询计划,提升写入性能
D. 缓存查询计划,后续相同的查询可以性能加速
17.MySQL索引最多包含多少个列?
A. 1
B. 2
C. 16
D. 5
18.MySQL创建一个字段索引的语句是?
A. create index index_name on table_name (columnname)
B. create index index_name
C. create index index_name (columnname)
D. create index index_name on table_name
19.使用SQL命令如何查看当前MySQL的版本?
A. SELECT VERSION
B. SELECT VERSIONS( )
C. SELECT V( )
D. SELECT VERSION( )
20.MySQL如何修改默认的端口号?
A. my_port = 3306
B. port = 3306
C. mysql_port = 3306
D. sql_port = 3306
21.InnoDB引擎设置读取缓存的参数?
A. read_buffe = 2097152
B. read_buffer_size = 2097152
C. buffer_size = 2097152
D. write_buffer_size = 2097152
22.使用SQL命令如何查看当前MySQL的数据库用户账号?
A. SELECT USERS( )
B. SELECT USER( )
C. SELECT USER
D. SELECT USERS
23.如何开启MySQL的Binlog功能?
A. log-bin=mysql-bin
B. log-bin=bin
C. log-bin=mysql
D. log-bin=my
24.MySQL如何配置数据文件目录?
A. mysql.txt中修改datadir = /var/mysql/data
B. mysql.cnf中修改data = /var/mysql/data
C. mysql.cnf中修改datadir = /var/mysql/data
D. mysql.config中修改datadir = /var/mysql/data
25.使用SQL命令如何查看当前MySQL的数据库名称?
A. SELECT DATABASE( )
B. SELECT DATABASES( )
C. SELECT DATABASE
D. SELECT DATABASES
26.mysql如何查看日志log?
A. 查看默认的日志文件/var/log/my.log
B. 查看默认的日志文件/var/lo.log
C. 查看默认的日志文件/var/log
D. 查看默认的日志文件/var/log/mysqld.log
27.MySQL如何开启一个事务Transaction?(多选题)
A. Create
B. Add
C. BEGIN
D. START TRANSACTION 显式地开启一个事务;
28.表变量和临时表的区别是?(多选题)
A. 表变量在内存
B. 临时表有实际的物理文件
C. 表变量不存储数据
D. 临时表不存储数据
29.execute,executeQuery,executeUpdate的区别? (多选题)
A. execute执行增删改成命令
B. executeQuery执行查询命令
C. executeUpdate执行更新命令
D. executeUpdate执行删除命令
30.JDBC连接池核心参数包括?(多选题)
A. initialSize
B. maxIdle
C. minIdle
D. maxActive
E. maxWait
31.BLOB类型主要包括?(多选题)
A. TINYBLOB
B. BLOB
C. LONGBLOB
D. MEDIUMBLOB
32.哪种数据库隔离级别能防止脏读?(多选题)
A. Read committed
B. Read uncommitted
C. Serializable
D. Repeatable read