Skip to content
SQL queries practices using Employees data
DataFrameas
df
variable
-- Explore the data in the table
SELECT *
FROM employees
LIMIT 5DataFrameas
df1
variable
select * from salaries limit 5;DataFrameas
df2
variable
select * from titles limit 5;DataFrameas
df4
variable
select * from dept_emp limit 5;DataFrameas
df3
variable
select count(*) from dept_emp;
-- select count(*) from salaries;
-- select count(*) from titles;DataFrameas
df5
variable
select count(*) from salaries;DataFrameas
df6
variable
select count(*) from titles;DataFrameas
df7
variable
select count(*) from employees;DataFrameas
df8
variable
# Find the second highest salary from the Employee table.
select max(salary) 2highestsalary
from salaries
where salary < (select max(salary) from salaries)DataFrameas
df9
variable
# Get the names of departments with more than 10 employees.
select
from