SQL Query: How to fetch Salary of Same Hiredate

Which SQL statement will retrieve the employee number (EMPNO), hire date (Hredate), and salary (SALARY) for each employee from a table named EMPLOYEE who was hired before 1998 and earns a salary of less than $35,000.00 per year?

Here are four options (A, B, C & D). Choose correct option.

Option-A

SELECT empno, hiredate, salary
FROM employee
FOR hiredate < ‘1998-01-01’ AND salary < 35000

Option-B

B. SELECT empno, hiredate, salary
FROM employee
WHERE hiredate < ‘1998-01-01’ AND salary < 35000

Option-C

C. SELECT empno, hiredate, salary
FROM employee
WHERE hiredate < ‘1998-01-01’ OR salary < 35000

Option-D

D. SELECT empno, hiredate, salary
FROM employee
FOR hiredate <‘1998-01-01’ OR salary < 35000

Answer: B

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.