Workspace
Raghavareddy Malireddy/

Course Notes: Introduction to Relational Databases in SQL

0
Beta
Spinner

add text here

In the SQL cell below:

  • Set the source to 'Course Databases' to query databases used in SQL courses.
  • Set the source to 'DataFrames and CSVs' to query this course's CSV files (if any) with SQL
  • Write SQL! Note that you cannot run queries that modify the database.
Unknown integration
DataFrameavailable as
df
variable
-- Select the names and most recent salaries of all current employees
-- Note that the query may take a long time to run if you remove the LIMIT statement
SELECT first_name,
        last_name,
        hire_date,
        salary
FROM employees
  INNER JOIN salaries USING(emp_no)
WHERE to_date = (SELECT MAX(to_date) FROM salaries)
ORDER BY emp_no
LIMIT 5
This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.
  • AI Chat
  • Code