Classic SQL exercises about MySQL

Classic SQL exercises about MySQL

In this article, I will introduce you to some classic MySQL SQL exercises and provide corresponding source code. These exercises are designed to help you become familiar with the query language of the MySQL database and improve your skills in SQL programming.

  1. Query the names and salaries of all employees
SELECT 姓名, 薪水
FROM 员工表;
  1. Query the names and number of employees of all departments
SELECT 部门名称, COUNT(*) AS 员工数量
FROM 员工表
GROUP BY 部门名称;
  1. Query the names and salaries of employees whose salary is greater than 10,000

Guess you like

Origin blog.csdn.net/update7/article/details/132902682