w3resource
SQL exercises

SQL: Display all the data of employees that work in department 47 or department 63

SQL Boolean Operator Statement : Exercise-12 with Solution

Write a query in SQL to display all the data of employees that work in department 47 or department 63.

Sample table : emp_details

Sample Solution :

SELECT * 
 FROM emp_details
  WHERE emp_dept = 47 OR emp_dept = 63;

Output:

Display employees  for one or more specific departments

Query Visualization:

Duration:

Query visualization of Display all the data of employees that work in department 47 or department 63 - Duration

Rows:

Query visualization of Display all the data of employees that work in department 47 or department 63 - Rows

Cost:

Query visualization of Display all the data of employees that work in department 47 or department 63 - Cost

Practice Online


Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a query in SQL to find the data of employees whose last name is Dosni or Mardy.
Next: SQL Wildcard and Special operators Exercises Home

What is the difficulty level of this exercise?



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