Find all customers named John Smith.

To find all customers named John Smith, we can run a query against a table of customer names. The query would return all rows where the first name is "John" and the last name is "Smith".

Problem

Given a table of customer's first and last names, write a query to find all customers whose first name is "John" and last name is "Smith".
Example input:
First_Name | Last_Name
-----------|-----------
John       | Smith
Mike       | Smith
John       | Doe
Example output:
First_Name | Last_Name
-----------|-----------
John       | Smith

Solution

This solution is in SQL. Our A.I. can create solutions in multiple languages.
by sarastevens
SELECT First_Name, Last_Name
FROM Customers
WHERE First_Name = 'John' AND Last_Name = 'Smith';

/*

The solution above is optimal because it uses the WHERE clause to filter the results to only include customers with the first name "John" and the last name "Smith".

*/

A.I. Evaluation of the Solution

The solution above is optimal because it uses the WHERE clause to filter the results to only include customers with the first name "John" and the last name "Smith".

Evaluated at: 2022-11-13 04:15:51