﻿ SQL SUBQUERIES: Find those employees whose ID matches any of the numbers 134, 159 and 183 - w3resource

# SQL Subquery Exercises: Display all the information of an employee whose id is any of the number 134, 159 and 183

## SQL SUBQUERY: Exercise-8 with Solution

From the following table, write a SQL query to find those employees whose ID matches any of the numbers 134, 159 and 183. Return all the fields.

Sample table: employees

Sample Solution:

``````SELECT *
FROM employees
WHERE employee_id IN (134,159,183);
``````

Sample Output:

```employee_id	first_name	last_name	email	phone_number 		hire_date	job_id 	salary commission_pct	manager_id	department_id
134		Michael		Rogers		MROGERS	650.127.1834		2006-08-26	ST_CLERK	2900.00	  0.00		122		50
159		Lindsey		Smith		LSMITH	011.44.1345.729268	2005-03-10	SA_REP		8000.00   0.30		146		80
183		Girard		Geoni		GGEONI	650.507.9879		2008-02-03	SH_CLERK	2800.00	  0.00		120		50
```

Relational Algebra Expression:

Relational Algebra Tree:

Pictorial Presentation:

## Query Visualization:

Duration:

Rows:

Cost:

Test your Programming skills with w3resource's quiz.

What is the difficulty level of this exercise?

﻿

## SQL: Tips of the Day

"where 1=1" statement?

It's usually when folks build up SQL statements.

When you add and value = "Toyota" you don't have to worry about whether there is a condition before or just WHERE.

Ref: https://bit.ly/3cayyhJ