89.0k views
1 vote
In an SQL query, which SQL keyword is used to join two conditions that both must be true for the rows to be selected?

a) AND
b) EXISTS
c) HAVING
d) IN
e) OR

User Lvca
by
8.1k points

1 Answer

1 vote

Final answer:

Correct Answer is a) .In an SQL query, the keyword 'AND' is used to join two conditions that must both be true for the rows to be selected.

Step-by-step explanation:

When constructing an SQL query, the keyword used to join two conditions that must both be true for the rows to be selected is AND. This means that in a 'WHERE' clause of an SQL statement, when you want to explain that two conditions must be met, you use the 'AND' operator.

For example, if you want to find employees in a database who work in the 'IT' department and have a salary greater than 50000, your SQL query would look something like:

SELECT * FROM employees WHERE department = 'IT' AND salary > 50000;

In this example, both conditions to the right of the 'AND' need to be true for a row to be included in the results.

User Beyondo
by
8.0k points