Country or region and language

    Choose your country or region and your language.

    Suggested for you

      All countries and regions

        Choose your character

        It shows in the top bar and on your profile. Change it any time.

        The Work Gym / Playgrounds

        SQL playground

        An online SQL editor with a sample store database already loaded. Write any query, run it with Ctrl + Enter and see the rows. You don't need an account, and there is nothing to install.

        Opening the workspace

        Embed this playground on your site

        What you can try

        1. Filter and sort: SELECT name, price FROM products WHERE category = 'Kitchen' ORDER BY price DESC;
        2. Count and total by group with GROUP BY, then keep only the big groups with HAVING.
        3. Join orders to customers to see who bought what, then use a LEFT JOIN to find customers with no orders.
        4. Rank products inside each category: RANK() OVER (PARTITION BY category ORDER BY price DESC).
        5. Build monthly revenue with a WITH clause and DATE_TRUNC('month', order_date).
        6. Find employees who earn more than their manager by joining employees to itself.

        The sample data

        Kestrel, a fictional online store for home and kitchen goods, in five tables: products (price, cost and stock), customers (city, country and loyalty tier), orders (dates, status, coupon code and total), order_items (one row per product in an order) and employees (department, manager and salary). Open Tables to see every column, and click a table name to preview its rows.

        Learn it step by step

        The playground checks nothing. In the course, lessons come in order and every exercise is checked the moment you finish it, with a hint that names the mistake. The first unit is free.

        Course: SQLLesson 1: SELECT: choose the columns you needLesson 2: WHERE: keep only the rows you wantLesson 9: GROUP BY: totals for each groupLesson 43: Window functions: ROW_NUMBER, RANK and DENSE_RANKLesson 33: CTEs: name a step with WITHTest your level

        Questions about the playground

        Which SQL dialect does it run?

        DuckDB, which follows standard SQL closely: joins, GROUP BY, window functions, CTEs, CASE and date functions work the way they do in PostgreSQL for most queries. Syntax that only one product has, such as SQL Server's TOP, may not run; use LIMIT instead.

        Does the database run on a server?

        No. The database engine runs inside your browser tab, so your queries never leave your computer and a slow query cannot affect anyone else.

        Can I open my own CSV?

        Yes. Open Your own CSV above the workspace and choose Open CSV. Use comma-separated UTF-8 text with a header, up to 512 KB, 2,000 data rows, 50 columns and 25,000 cells including the header. You can save named projects in this browser or download the current data as CSV. These saves do not sync to your account. XLSX is not supported.

        Is the SQL playground free?

        Yes. You don't need an account or a card, and it runs in your browser, so there is nothing to install.

        Is my work saved?

        Only in this browser. The playground keeps your last session on this device so it is there when you come back, and sends nothing to an account. Start again puts the sample data back.

        Other playgrounds

        Your Work Gym account

        Save your progress and pick up on another device. Your browser's progress comes with you.

        New accounts get 12 hours of full access: every course, unit, project and exam. The clock starts when you open your first lesson.

        Plan your practice from a job ad or syllabus

        Have a referral code?

        or

        You can keep practicing without an account.

        Change your plan

        Checking the price

        Help and feedback

        Ask a question, tell us what is not working, or share an idea. We reply by email.

        What is it about?

        We use it only to reply to you.