w3resource
SQL exercises

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

Write a statement to display all the information of an employee whose id is any of the number 134, 159 and 183.

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

Practice Online


Query Visualization:

Duration:

Query visualization of Display all the information of an employee whose id is any of the number 134, 159 and 183 - Duration

Rows:

Query visualization of Display all the information of an employee whose id is any of the number 134, 159 and 183 - Rows

Cost:

Query visualization of Display all the information of an employee whose id is any of the number 134, 159 and 183 - Cost

Contribute your code and comments through Disqus.

Previous: Write a query to display all the information of an employee whose salary and reporting person id is 3000 and 121 respectively.
Next: Write a query to display all the information of the employees whose salary is within the range 1000 and 3000.

What is the difficulty level of this exercise?



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