LogiQuest
Back to SQL Basics
13

Using the tables below, what is the result of this query?

emp
id | name  | dept  | salary | manager_id
1  | Asha  | IT    | 70000  | NULL
2  | Ravi  | IT    | 50000  | 1
3  | Meena | HR    | 45000  | 1
4  | John  | Sales | 40000  | 3
5  | Sara  | Sales | 55000  | 3
6  | Imran | IT    | 60000  | 2
7  | Lata  | HR    | NULL   | 3

dept
code  | title      | city
IT    | Technology | Chennai
HR    | People     | Pune
Sales | Revenue    | Mumbai
Ops   | Operations | Delhi
SELECT name FROM emp WHERE dept IN ('HR', 'Sales') AND salary < 50000 ORDER BY name;
Medium

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.