In a company's employee database, there is a table named 'Employees' that includes fields such as 'ID', 'Name', 'Department', and 'Email'. You need a list of the names and email addresses of all employees who work in the 'Marketing' department. Which SQL query would you use?
SELECT Department FROM Employees WHERE Name = 'Marketing';
SELECT Name, Email FROM Employees WHERE Department = 'Marketing';
SELECT Name, Email FROM Employees;
SELECT * FROM Employees WHERE Department = 'Sales';
The correct query is "SELECT Name, Email FROM Employees WHERE Department = 'Marketing';" because it specifies the 'Name' and 'Email' columns to retrieve, identifies the 'Employees' table, and filters the rows using the WHERE clause so that only records where the Department equals 'Marketing' are returned. The other choices are incorrect because they either select the wrong columns, use the wrong filter value, omit the filter entirely, or apply the condition to the wrong field.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the WHERE clause do in SQL?
Open an interactive chat with Bash
What is the difference between SELECT * and specifying columns like Name, Email in SQL?
Open an interactive chat with Bash
How can SQL handle conditions with multiple values, like selecting Marketing and Sales employees?