137k views
2 votes
Given a table with the structure: EMPLOYEE (EmpNo, Name, Salary, HireDate), which of the following would find all employees whose name begins with the letter "S"?

a) SELECT *
FROM EMPLOYEE
WHERE Name IN ['S'];
b) SELECT EmpNo
FROM EMPLOYEE
WHERE Name LIKE 'S';
c) SELECT *
FROM Name
WHERE EMPLOYEE LIKE 'S*';
d) SELECT *
FROM EMPLOYEE
WHERE Name LIKE 'S%';
e) None of the above.

1 Answer

4 votes

Final answer:

The correct query to find all employees whose name begins with the letter 'S' is: SELECT FROM EMPLOYEE WHERE Name LIKE 'S%'.

Step-by-step explanation:

The correct query to find all employees whose name begins with the letter 'S' is:

SELECT * FROM EMPLOYEE WHERE Name LIKE %

This query uses the LIKE operator with the wildcard '%' to match any character(s) after the letter S. This means it will find all names that start with followed by any number of characters. The 'SELECT statement retrieves all columns from the 'EMPLOYEE' table for the matching records.

User Victor Company
by
8.3k points