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 DifficultyHard SQL
Write a SQL query to find the second highest salary from the employees table.
About this solution: The solution above is optimal because it uses a subquery to find the maximum salary and then uses that value to find the second highest salary.
Nov 24
Databases / SQL DifficultyHard SQL
This technical problem deals with writing a SQL query to find all parents who have at least one child. The example input and output are provided in the body of the problem.
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 using DISTINCT to remove any duplicate rows.
Nov 24
Databases / SQL DifficultyHard SQL
The average salary of all employees in a company can be found using a SQL query. For example, if the employees table contains the following columns: ID, NAME, and SALARY, the average salary can be calculated by querying the table for the average value of the SALARY column.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The solution is also optimal, as it is the simplest solution that will return the correct result.
Nov 24
Databases / SQL DifficultyHard SQL
Given a table of employee data, this SQL query will find all employees who have been with the company for more than 5 years.
About this solution: This solution is complete and solves the problem. The approach is straightforward and easy to follow.
Nov 24
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
This technical problem involves writing a SQL query to find products with a price greater than the average price of all products.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The solution solves the problem and uses the correct SQL syntax. The candidate's approach is efficient because it only requires one query to the database.
Nov 23
Databases / SQL DifficultyHard SQL
This technical problem deals with finding pairs of records from two tables that have the same value for a common column.
About this solution: The solution above is optimal because it uses an inner join to find the records that have the same value for column C.
Nov 23
Databases / SQL DifficultyHard SQL
To find the top 5 most expensive items in the database, write a SQL query that orders the items by price in descending order.
About this solution: The solution above is optimal because it uses the ORDER BY and LIMIT clauses to sort the items by price in descending order and then limit the results to the top 5 items.
Nov 23