Backup and Recovery

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 finding the number of rows in a table where the values in two columns are equal. The input is a table with two columns, and the output is the number of rows where the values in the two columns are equal.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The solution uses a single query to return the number of rows where the values in the two columns are equal, which is the optimal approach.
Nov 15
Databases / SQL DifficultyMedium SQL
This technical problem deals with writing a SQL query to find the top 10 customers by total amount spent. The input is a table of customer data, including customer IDs, names, and total amount spent. The output should be a table with the customer IDs, names, and total amount spent, sorted in descending order by total amount spent.
About this solution: The candidate's solution is correct and demonstrates a good understanding of SQL. The candidate has used the ORDER BY and LIMIT clauses to sort the table by total_spent in descending order and then limit the results to the top 10 customers.
Nov 14
Databases / SQL DifficultyMedium SQL
The table given contains a list of users and when they last logged in. The goal is to write a SQL query that returns the id, username, and password for all users who logged in within the last 24 hours.
About this solution: The solution above is optimal because it uses the NOW() function to get the current time and subtracts 1 day from it. This is optimal because it will always return the correct results.
Nov 14
Databases / SQL DifficultyMedium SQL
To find all customers named John Smith, we can run a query against a table of customer names. The query would return all rows where the first name is "John" and the last name is "Smith".
About this solution: The solution above is optimal because it uses the WHERE clause to filter the results to only include customers with the first name "John" and the last name "Smith".
Nov 13
Databases / SQL DifficultyMedium SQL
This technical problem involves writing a SQL query to find all customers who have placed an order in the last 30 days. The example input data consists of a customers table with id and name columns, and an orders table with id, customer_id, and order_date columns. The example output lists the id and name columns for all customers who have placed an order in the last 30 days.
About this solution: This solution is complete and solves the problem. The approach is to join the customers and orders table on the customer id and then filter for orders that have been placed in the last 30 days. This approach is sensible and efficient.
Nov 12
Databases / SQL DifficultyMedium SQL
This technical problem asks the reader to write a SQL query that finds the most recent backup for each database on a server. The example input provided shows two databases, each with a different last backup date. The expected output is the same as the input.
About this solution: The candidate's solution is correct and demonstrates a good understanding of SQL.
Nov 12
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
This technical problem involves writing a SQL query that returns the names of customers who have placed orders with a total value of more than $100.
About this solution: The solution above is optimal because it uses a JOIN to combine the orders and customers tables. This allows us to access the name column from the customers table.
Nov 06