热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

面试准备

MySQL 面试题与答案

Test your skills through the online practice test: MySQL Quiz Online Practice Test

问题 101. How To Use IN Conditions?

An IN condition is single value again a list of values. It returns TRUE, if the specified value is in the list. Otherwise, it returns FALSE. Some examples are given in the tutorial exercise below:

SELECT 3 IN (1,2,3,4,5) FROM DUAL;
1

SELECT 3 NOT IN (1,2,3,4,5) FROM DUAL;
0

SELECT 'Y' IN ('F','Y','I') FROM DUAL;
1

这有帮助吗? 添加评论 查看评论
 

问题 102. How To Create a New View in MySQL?

You can create a new view based on one or more existing tables by using the "CREATE VIEW viewName AS selectStatement" statement as shown in the following script:

mysql> CREATE TABLE comment (faqID INTEGER,
message VARCHAR(256));
Query OK, 0 rows affected (0.45 sec)

mysql> INSERT INTO comment VALUES (1, 'I like it');
Query OK, 1 row affected (0.00 sec)

mysql> CREATE VIEW faqComment AS SELECT f.id, f.title,
f.description, c.message FROM faq f, comment c
WHERE f.id = c.faqID;
Query OK, 0 rows affected (0.06 sec)

这有帮助吗? 添加评论 查看评论
 

问题 103. How To Use LIKE Conditions?

A LIKE condition is also called pattern patch. There are 3 main rules on using LIKE condition:

* '_' is used in the pattern to match any one character.
* '%' is used in the pattern to match any zero or more characters.
* ESCAPE clause is used to provide the escape character in the pattern.

The following tutorial exercise provides you some good pattern matching examples:

SELECT 'WithoutBook.com' LIKE '%center%' FROM DUAL;
1

SELECT 'WithoutBook.com' LIKE '%CENTER%' FROM DUAL;
1
-- Case insensitive by default

SELECT 'WithoutBook.com' LIKE '%CENTER_com' FROM DUAL;
1

这有帮助吗? 添加评论 查看评论
 

问题 104. How To Drop an Existing View in MySQL?

If you have an existing view, and you don't want it anymore, you can delete it by using the "DROP VIEW viewName" statement as shown in the following script:

mysql> DROP VIEW faqComment;
Query OK, 0 rows affected (0.00 sec)

这有帮助吗? 添加评论 查看评论
 

问题 105. How To Use Regular Expression in Pattern Match Conditions?

If you have a pattern that is too complex for LIKE to handle, you can use the regular expression pattern condition: REGEXP. The following tutorial exercise provides you some good examples:

SELECT 'WithoutBook.com' REGEXP '.*ggl.*' FROM DUAL;
1

SELECT 'WithoutBook.com' REGEXP '.*com$' FROM DUAL;
1

SELECT 'WithoutBook.com' REGEXP '^F.*' FROM DUAL;
1

这有帮助吗? 添加评论 查看评论
 

用户评价最有帮助的内容:

版权所有 © 2026,WithoutBook。