Complete SQL Syllabus with Examples (Colored)
How SQL Looks Like - Syntax and Example
-- SQL Example: Retrieving employee names and salaries where salary > 70000, sorted by salary
descending
SELECT name, salary
FROM employees
WHERE salary > 70000
ORDER BY salary DESC;
-- Explanation:
-- SELECT: Columns to retrieve
-- FROM: Table to retrieve data from
-- WHERE: Condition to filter rows
-- ORDER BY: Sorts the results