SQL(结构化查询语言)是一种用于管理关系数据库的编程语言
SELECT name, age FROM employees;
SELECT name, age FROM employees WHERE age > 30;
SELECT name, age FROM employees ORDER BY age DESC;
SELECT department, COUNT(*) FROM employees GROUP BY department;
SELECT e.name, e.age, d.department_name
FROM employees e
JOIN departments d ON e.department = d.department_id;
UPDATE employees SET salary = salary * 1.1 WHERE age > 30;
DELETE FROM employees WHERE age > 60;
INSERT INTO employees (name, age, department, salary)
VALUES ('John Doe', 35, 1, 50000);
这些基本案例展示了SQL的一些常见用法。实际应用中,SQL查询可能会更复杂,包括子查询、聚合函数等。但这些基本概念为理解和编写SQL查询提供了良好的起点。