Subqueries
  • AI Chat
  • Code
  • Report
  • Beta
    Spinner
    Unknown integration
    DataFrameavailable as
    df
    variable
    -- Select the names, hire date and salaries of the 10 highest paid employees
    SELECT DISTINCT employees.emp_no,
            first_name,
            last_name,
            hire_date,
            salary
    FROM employees
    JOIN salaries
      on salaries.emp_no = employees.emp_no
    WHERE employess.emp_no in (SELECT emp_no
                       FROM salaries
                      WHERE to_date >= CURDATE()
    )
    
    This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.
    Unknown integration
    DataFrameavailable as
    df
    variable
    SELECT emp_no
    FROM salaries
    WHERE to_date >= CURDATE()
    ORDER 
       BY salary desc
    LIMIT 10
    This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.