Transactions

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
This technical problem involves writing a SQL query to return all customers who have made a purchase in the last 30 days, as well as the total amount they have spent.
About this solution: This solution is complete and solves the problem. It uses a JOIN to combine information from the customers and purchases table and then uses the GROUP BY clause to sum the total amount spent for each customer. The solution also uses the DATE_SUB function to only consider purchases made in the last 30 days.
Nov 27
Databases / SQL DifficultyHard SQL
Given a table of transactions, this SQL query will find the total value of all transactions that occurred on each day.
About this solution: This solution is complete and solves the problem. It uses a GROUP BY clause to group together all transactions that occurred on the same date, and then sums the value of those transactions.
Nov 25
Databases / SQL DifficultyHard SQL
To find the second highest salary from a SQL database, you can use a subquery. This subquery will return the salary of the employee with the second highest salary.
About this solution: The candidate's solution is correct and demonstrates a good understanding of how to use the ORDER BY, LIMIT, and OFFSET clauses in SQL to solve the problem.
Nov 19
Databases / SQL DifficultyMedium SQL
Given a table of transactions, this SQL query will find the total value of all transactions for each day.
About this solution: The solution above is optimal because it uses the GROUP BY clause to group the transactions by date. The SUM function is used to sum the values of each group.
Nov 18
Databases / SQL DifficultyMedium SQL
This technical problem involves writing a function that takes a string and a character as arguments, and returns the number of times the character appears in the string.
About this solution: The solution provided is a valid solution that uses built-in functions to solve the problem. The approach is sound and the solution is complete.
Nov 11
Databases / SQL DifficultyMedium SQL
This problem asks for a SQL query that returns the average transaction value for each day. The example input table has three days, with transaction values of 10, 20, and 30 respectively. The expected output table would have the same three days, with average values of 10, 15, and 20.
About this solution: The solution above is optimal because it uses the AVG function to calculate the average value for each day.
Nov 10
Databases / SQL DifficultyMedium SQL
Write a SQL query to find all products in a table that cost more than $10.
About this solution: The candidate's solution is correct and demonstrates a good understanding of SQL. The solution is also efficient, as it uses the WHERE clause to filter the results.
Nov 10
Databases / SQL DifficultyMedium SQL
Write a SQL query to find the 10 most popular articles on a blog, based on the number of likes.
About this solution: The candidate's solution is correct and demonstrates a good understanding of SQL. The solution is also efficient, as it uses the ORDER BY and LIMIT clauses to retrieve the desired data.
Nov 09