125k views
1 vote
Find the EmpId, EmpLName and Status in a table named “Employees” whose status is neither contractor nor consultant.

a) SELECT EmpID, EmpLName, Status FROM Employees WHERE status NOT IN (‘contractor, ‘consultant’)

b) SELECT EmpID, EmpLName, Status FROM Employees WHERE status NOT BETWEEN (‘contractor, ‘consultant)

c) SELECT EmpID, EmpLName, Status FROM Employees WHERE status IN (‘contractor, ‘consultant)

d) SELECT EmpID, EmpLName, Status FROM Employees WHERE status BETWEEN (‘contractor, ‘consultant);

User Nobita
by
8.1k points

1 Answer

2 votes

Answer:

a) SELECT EmpID, EmpLName, Status FROM Employees WHERE status NOT IN ('contractor', 'consultant')

Step-by-step explanation:

This SQL query is selecting the EmpId, EmpLName, and Status columns from the "Employees" table, but it is filtering the results to only include rows where the Status is not equal to "contractor" or "consultant". The keyword "NOT" is used to negate the condition of the "IN" operator, which means the query will return all the rows where the status is not contractor or consultant.

User Montycarlo
by
7.7k points