Databases / SQL / Database Normalization

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 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: This solution is complete and solves the problem. The approach is straightforward and easy to follow.
Jan 21
Databases / SQL DifficultyHard SQL
This technical problem asks the reader to write a SQL query to find the second highest salary from a given table of employees. An example table is provided, along with the expected output.
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 26
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
The problem is to write a query to return the average price of all products in an unnormalized database table. The table includes the attributes productID, productName, productDescription, and productPrice.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The candidate's approach is straightforward and solves the problem efficiently.
Nov 23
Databases / SQL DifficultyHard SQL
Given a database table with a schema as shown above, write a SQL query that returns the total value of all products in the table.
About this solution: The candidate's solution is correct and demonstrates a good understanding of SQL. The solution is also optimal, as it is a single query that does not require any joins or subqueries.
Nov 21
Databases / SQL DifficultyHard SQL
The table given contains information on employees, including their ID, name, manager ID, and department. The goal is to write a SQL query that returns the ID and name of all employees who are not managers and who are in the Sales department. From the given example input, the expected output would be the ID and name of Joe and Karen.
About this solution: The candidate's solution is correct and demonstrates a good understanding of SQL. The candidate has correctly used the WHERE clause to filter out the rows that do not meet the criteria. The candidate has also correctly used the IS NULL operator to check for employees who are not managers.
Nov 19
Databases / SQL DifficultyHard SQL
Given a table with two columns, "name" and "parent", write a SQL query to find all the children of the parent "A".
About this solution: The candidate's solution is correct and demonstrates a good understanding of SQL. The solution is also efficient, using the WHERE clause to filter the results.
Nov 19
Databases / SQL DifficultyHard SQL
To find the third highest salary in a table, you can use a simple ORDER BY and LIMIT clause in SQL.
About this solution: The candidate's solution is correct and uses an optimal approach.
Nov 19