Databases / SQL

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 asks for a SQL query to find all pairs of rows in a table where the values in the two columns are equal. The example input and output show what such a query would return.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The solution solves the problem and is a general approach.
Nov 08
Databases / SQL DifficultyMedium SQL
This technical problem deals with finding all products that cost more than $10 from a list of products and their prices.
About this solution: The candidate's solution is correct and demonstrates a good understanding of SQL. The solution is also simple and easy to understand, which is always a good thing.
Nov 08
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 SQL
The writer is asking how to count the number of replies in a topic, when replies are only associated with threads, which are in turn associated with topics.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The candidate has correctly identified that a subquery is needed to get the ThreadIDs that are in the topic, and then counts the number of replies that are in those threads.
Nov 08
Databases / SQL DifficultyMedium SQL
Write a SQL query to find the names of the two highest scoring individuals in a table of data.
About this solution: The candidate's solution is correct and demonstrates a good understanding of SQL.
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 SQL
This technical problem deals with finding the most recent backup for each database on a server. Given a table of backup information, the goal is to write a query that returns the most recent backup for each database.
About this solution: The solution above is optimal because it uses a subquery to find the most recent start_time for each database.
Nov 07
Databases / SQL DifficultyMedium SQL
Write a SQL query to find the top 5 most expensive items in the "Electronics" category.
About this solution: The solution is optimal because it uses the ORDER BY clause to sort the results in descending order by price, and the LIMIT clause to limit the results to the top 5 most expensive items.
Nov 07