Challenge - 5 Problems
Database Design Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Why use normalization in database design?
Which of the following best explains the main purpose of normalization in database design?
Attempts:
2 left
💡 Hint
Think about how normalization helps keep data consistent and organized.
✗ Incorrect
Normalization organizes data to reduce duplication and ensures data integrity by structuring tables properly.
❓ query_result
intermediate2:00remaining
Identify the correct foreign key relationship
Given two tables, Orders and Customers, which SQL statement correctly creates a foreign key from Orders to Customers?
SQL
CREATE TABLE Customers ( CustomerID INT PRIMARY KEY, Name VARCHAR(100) ); CREATE TABLE Orders ( OrderID INT PRIMARY KEY, CustomerID INT, OrderDate DATE );
Attempts:
2 left
💡 Hint
The foreign key should link the child table to the parent table's primary key.
✗ Incorrect
The foreign key in Orders references the primary key CustomerID in Customers to link orders to customers.
📝 Syntax
advanced1:30remaining
Find the syntax error in table creation
Which option contains a syntax error when creating a table with a primary key and a unique constraint?
SQL
CREATE TABLE Employees ( EmployeeID INT PRIMARY KEY, Email VARCHAR(255) UNIQUE );
Attempts:
2 left
💡 Hint
Check the placement and usage of the UNIQUE keyword and CONSTRAINT keyword.
✗ Incorrect
Option D incorrectly uses UNIQUE CONSTRAINT together without proper syntax, causing a syntax error.
❓ optimization
advanced2:00remaining
Choose the best indexing strategy
You have a large table with millions of rows and frequent queries filtering by the column
last_name. Which indexing strategy improves query speed without wasting much space?Attempts:
2 left
💡 Hint
Think about the type of queries and the best index type for filtering by a column.
✗ Incorrect
B-tree indexes are efficient for filtering and sorting on columns like last_name, improving query speed.
🔧 Debug
expert2:30remaining
Identify the cause of data inconsistency
A database has two tables:
Products and Orders. Sometimes, orders reference product IDs that do not exist in Products. What is the most likely cause?Attempts:
2 left
💡 Hint
Think about what enforces valid references between tables.
✗ Incorrect
Without a foreign key constraint, the database does not enforce that product IDs in Orders must exist in Products, causing inconsistency.