Write a SQL query to find all users with the role of 'admin' or 'manager'.
Given a table of users and their roles, write a SQL query to find all the users who have the role of 'admin' or 'manager'. Example input: | id | name | role | |----|-------|-------| | 1 | John | admin | | 2 | Sarah | user | | 3 | Mike | manager| Example output: | id | name | |----|-------| | 1 | John | | 3 | Mike |
SELECT id, name FROM users WHERE role = 'admin' OR role = 'manager'; /* The solution above is optimal because it uses the WHERE clause to filter the results. */
The solution above is optimal because it uses the WHERE clause to filter the results.
Evaluated at: 2022-11-25 02:16:27