Check these solutions from our community:

Write a SQL query to find all users with the role of 'admin' or 'manager'.

About this solution: The solution above is optimal because it uses the WHERE clause to filter the results.

This technical problem involves writing a SQL query that returns the salt for a given user's password. The example input and output are provided in the body of the problem.

About this solution: The candidate's solution is correct and efficient.

This technical problem deals with writing a function that can take in a database name and table name, and return the number of rows in the table.

About this solution: The candidate's solution is complete and solves the problem. The candidate's approach is to use the COUNT() function, which is an optimal way to count the number of rows in a table.

The goal is to find the number of unique users in a table. The table has the following columns: user_id, name. The query should return the number of unique users. In the example above, the answer would be 3.

About this solution: The candidate's solution is correct and uses an efficient method to count the number of unique users.

This technical problem deals with writing a SQL query to find the number of users who have both a first and last name. The input is a table of user data, and the output is the number of users who have both a first and last name.

About this solution: The solution above is correct and demonstrates a level of completeness. It solves the problem and takes the optimal approach by only counting the number of users who have both a first and last name.

Databases / SQL
SQL

The table has two columns, id and data. The query should return the data in ascending order of id.

About this solution: The candidate's solution is correct and demonstrates a level of completeness. The solution is also optimal because it is the simplest solution that will return the data in ascending order of id.

Given two tables - one of users and one of permissions - write a SQL query to find all users who have the permission to view a certain resource.

About this solution: The candidate's solution is correct and demonstrates a good understanding of SQL. The solution is also efficient, using a JOIN to combine the two tables and then filtering the results.

This technical problem deals with writing a SQL query to find all the users who are in more than one role. The user table, role table, and user role table are provided, and the expected output is also given.

About this solution: The candidate's solution is complete and solves the problem. The approach is straightforward and easy to follow.