## Locking

#### Recent solutions:

Check these solutions from our community:
Databases / SQL DifficultyHard SQL
Design a SQL query that will return the titles of all books that are currently checked out from a library catalog.
About this solution: The candidate's solution is complete and solves the problem. The candidate's approach is straightforward and easy to understand.
Nov 28
Databases / SQL DifficultyHard SQL
This technical problem deals with getting all rows from a table, even if some of the rows are locked. The solution is to write a SQL query that will return all rows from the table.
About this solution: The candidate's solution is correct and demonstrates a good understanding of how to use the NOLOCK hint to read data from a table without being blocked by other processes.
Nov 25
Databases / SQL DifficultyHard SQL
Write a SQL query to sum the balances of all rows with an id greater than 5.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The candidate has correctly used the SUM function to add up the balances of all rows with an id that is greater than 5.
Nov 23
Databases / SQL DifficultyHard SQL
Given a table of data with three columns: id, start, and end, this SQL query will find all pairs of rows where the start and end times overlap.
About this solution: The candidate's solution is correct and demonstrates a good understanding of SQL. The solution is also optimal, as it uses a JOIN to find all pairs of rows that overlap.
Nov 20
Databases / SQL DifficultyHard SQL
This technical problem involves writing a query to find the number of items that are locked by each user in a given table. The output should show the user ID and the number of items locked for each user.
About this solution: This solution is complete and solves the problem. The approach is straightforward and easy to follow.
Nov 20
Databases / SQL DifficultyMedium SQL
Write a SQL query to find the names of all the items that have a price greater than or equal to \$10.
About this solution: The solution above is optimal because it uses the WHERE clause to filter the results to only include items with a price greater than or equal to 10.
Nov 10
Databases / SQL DifficultyMedium SQL
This technical problem involves writing a SQL query to return the names of employees who have been with the company for more than 5 years.