Databases

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
The number of customers who have placed an order in the last 30 days can be found by querying the orders table and counting the number of customer_id entries where the order_date is within the last 30 days.
About this solution: The candidate's solution is correct and demonstrates a good understanding of how to use the DATE_SUB function to get the date 30 days ago. The candidate's solution is also efficient because it uses the WHERE clause to filter the results.
Nov 04
Databases / SQL DifficultyMedium SQL
Write a SQL query to find the average price of all products in a database table.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The candidate's approach is also optimal, as it is the simplest way to get the average price of all products.
Nov 04
Databases / SQL DifficultyMedium SQL
Write a SQL query to find the average price of all products in a database table.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The candidate's approach is also optimal, as it is the simplest way to get the average price of all products.
Nov 04
Databases / SQL DifficultyMedium SQL
A trigger is needed that will update the "last_updated" column in a table every time a row is inserted or updated.
About this solution: The candidate's solution is complete and solves the problem. The approach is optimal because it only updates the last_updated column for the row that was inserted or updated.
Nov 04
Databases / SQL DifficultyMedium SQL
This technical problem involves writing a SQL query that returns the total revenue for each customer. The table schema is provided, and an example input and output are also given.
About this solution: The solution is optimal because it uses the GROUP BY clause to group the rows by customer_id and then uses the SUM function to sum the revenue for each customer.
Nov 04
Databases / SQL DifficultyMedium SQL
Write a SQL query that returns the total quantity of each product ordered by each customer.
About this solution: This solution is complete and solves the problem. The approach is straightforward and easy to follow.
Nov 04
Databases / SQL DifficultyMedium SQL
This question asks for the 5th highest salary from the "Employees" table. The example input is a table with id, name, and salary columns, and the example output is a table with a salary column.
About this solution: The candidate's solution correctly finds the 5th highest salary from the "Employees" table. The solution uses the correct SQL syntax and demonstrates a good understanding of the problem.
Nov 04
Databases / SQL DifficultyMedium 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 does not demonstrate a level of completeness and does not solve the problem. The general approach is to select all data from the table, but this does not return the data in ascending order of id. To solve the problem, the candidate would need to add an 'ORDER BY' clause to the query.
Nov 04