Locking

Categories: Code Problem / Data Structures and Algorithms / Recursion (32) Code Problem / Data Structures and Algorithms / Binary Search (30) Code Problem / Data Structures and Algorithms / Linked Lists (26) Code Problem / Data Structures and Algorithms / Backtracking (26) Code Problem / Data Structures and Algorithms / Stacks and Queues (25) Code Problem / Data Structures and Algorithms / Hashing (24) Databases / SQL / Backup and Recovery (19) Code Problem / Data Structures and Algorithms / Arrays and Strings (19) Databases / SQL / Database Normalization (18) Code Problem / Data Structures and Algorithms / Time Complexity (17) Databases / SQL / Locking (16) Databases / SQL / Replication (15) Databases / SQL / SQL Queries (13) Code Problem / Data Structures and Algorithms / Graphs (13) Databases / SQL / Database Security (13)  More...

Recent solutions:

Check these solutions from our community:
Databases / SQL DifficultyMedium SQL
This technical problem deals with updating rows in a table with a status of 0 to 1. The table is locked for writing, the rows are updated, and then the table is unlocked.
About this solution: This solution is correct and demonstrates a level of completeness. The approach is also optimal.
Nov 08
Databases / SQL DifficultyMedium SQL
This technical problem deals with finding employees who have worked on multiple projects. A SQL query is provided that returns the names of all employees who have worked on at least two projects.
About this solution: The solution is complete and solves the problem. The approach is to first get all employees who have worked on at least two projects and then return the names of those employees.
Nov 07
Databases / SQL DifficultyMedium SQL
This technical problem deals with writing a SQL query that returns the sum of all orders for each product_id. The given table has a schema with three columns: order_id, product_ id, and quantity. An example input and output is also provided.
About this solution: This solution is complete and solves the problem. The approach is straightforward and easy to follow.
Nov 07
Databases / SQL DifficultyMedium SQL
This technical problem deals with how to write a SQL query that returns rows from a table that have been locked by another process.
About this solution: The solution correctly returns the rows that have been locked. However, it is not the most efficient solution. A more efficient solution would be to use a subquery.
Nov 05
Databases / SQL DifficultyMedium SQL
This technical problem deals with how to write a SQL query that returns rows from a table that have been locked by another process.
About this solution: The solution correctly returns the rows that have been locked. However, it is not the most efficient solution. A more efficient solution would be to use a subquery.
Nov 05
Databases / SQL DifficultyMedium SQL
This technical problem involves finding the customer with the most orders in a given table. The table consists of customer order information, including customer id, order date, etc. The goal is to write a SQL query to identify the customer with the most orders.
About this solution: The candidate's solution does not demonstrate a level of completeness and does not solve the problem. The candidate's approach is to simply select all data from the customer orders table. This does not provide any information on which customer has the most orders. To solve the problem, the candidate would need to provide a GROUP BY clause to group customer orders by customer ID, and then use a COUNT function to count the number of orders for each customer.
Nov 02
Databases / SQL SQL
This technical problem deals with creating a function that will take in an array of integers and return the sum of all the even numbers in the array.
About this solution: The candidate's solution correctly calculates the sum of all even numbers in the array. However, the solution could be more concise. For example, the candidate could have used the built-in SUM function to calculate the sum, rather than creating a new table.
Oct 27
Databases / SQL SQL
This technical problem deals with creating a function that will take in an array of integers and return the sum of all the even numbers in the array.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The candidate's approach is also optimal, making use of a CASE statement to check if the number is even and then returning the number if it is even and 0 if it is not. The SUM function then adds up all the numbers in the column.
Oct 24