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

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

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

面试准备

SQL Query 面试题与答案

问题 6. Explain INNER JOIN and LEFT JOIN.

INNER JOIN returns rows when there is a match in both tables. LEFT JOIN returns all rows from the left table and matching rows from the right table.

Example:

SELECT * FROM table1 INNER JOIN table2 ON table1.id = table2.id;

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

问题 7. What is a primary key?

A primary key is a unique identifier for a record in a table. It must contain unique values and cannot be NULL.

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

问题 8. Write a SQL query to calculate the average salary for each department.

SELECT department, AVG(salary) FROM Employee GROUP BY department;

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

问题 9. Explain the difference between UNION and UNION ALL.

UNION combines and returns unique rows from multiple SELECT statements, while UNION ALL returns all rows including duplicates.

Example:

SELECT column1 FROM table1 UNION SELECT column1 FROM table2;

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

问题 10. What is an index in a database?

An index is a data structure that improves the speed of data retrieval operations on a database table at the cost of additional writes and storage space.

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

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

版权所有 © 2026,WithoutBook。