w3resource
SQL exercises

SQL SORTING and FILTERING on HR Database: Display all the information about the department Marketing

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

5. Write a query in SQL to display all the information about the department Marketing.

Sample table: departments


Sample Solution:

SELECT *
 FROM  departments
  WHERE department_name = 'Marketing';

Sample Output:

 department_id | department_name | manager_id | location_id
---------------+-----------------+------------+-------------
            20 | Marketing       |        201 |        1800
(1 row)

Practice Online


HR database model

Query Visualization:

Duration:

Query visualization of Display all the information about the department Marketing - Duration

Rows:

Query visualization of Display all the information about the department Marketing - Rows

Cost:

Query visualization of Display all the information about the department Marketing - Cost

Contribute your code and comments through Disqus.

Previous: Write a query in SQL to display all the information for all employees without any department number.
Next: Write a query in SQL to display the full name (first and last), hire date, salary, and department number for those employees whose first name does not containing the letter M and make the result set in ascending order by department number.

What is the difficulty level of this exercise?



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