w3resource
SQL exercises

SQL SORTING and FILTERING on HR Database: Display all the information for all employees without any department number

SQL SORTING and FILTERING on HR Database: Exercise-4 with Solution

4. Write a query in SQL to display all the information for all employees without any department number.

Sample table: employees


Sample Solution:

SELECT *
 FROM employees
  WHERE department_id IS NULL;

Sample Output:

employee_id | first_name | last_name | email | phone_number | hire_date | job_id | salary | commission_pct | manager_id | department_id
-------------+------------+-----------+-------+--------------+-----------+--------+--------+----------------+------------+-------------
(0 rows)

Practice Online


HR database model

Query Visualization:

Duration:

Query visualization of Display all the information for all employees without any department number - Duration

Rows:

Query visualization of Display all the information for all employees without any department number - Rows

Cost:

Query visualization of Display all the information for all employees without any department number - Cost

Contribute your code and comments through Disqus.

Previous: Write a query in SQL to display the first and last name, and department number for all employees whose last name is "McEwen".
Next: Write a query in SQL to display all the information about the department Marketing.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming