Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. What is a CTE?

SQL · Keys, Schema & CTEs

What is a CTE?

Easysql-40
ctewithreadability

Question

What is a CTE?

Solution

CTE = Common Table Expression.

WITH high_salary AS (
    SELECT *
    FROM employees
    WHERE salary > 100000
)
SELECT *
FROM high_salary;

It makes complex SQL easier to read and can also support recursive queries.

🎯 Put this concept into practice

Solidify this answer with real hands-on interview drills in the browser studio.

Open related drill →
PreviousNext