Challenge - 5 Problems
Tables Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate2:00remaining
Identify the number of rows returned
Given the table Employees with columns id, name, and department, what is the number of rows returned by this query?
SELECT * FROM Employees WHERE department = 'Sales';
SQL
SELECT * FROM Employees WHERE department = 'Sales';
Attempts:
2 left
💡 Hint
Think about how many employees belong to the Sales department.
✗ Incorrect
The query filters rows where the department is 'Sales'. There are exactly 3 such rows in the Employees table.
🧠 Conceptual
intermediate1:30remaining
Understanding columns in a table
Which of the following best describes a column in a database table?
Attempts:
2 left
💡 Hint
Think about how data is organized vertically in tables.
✗ Incorrect
A column holds data for one attribute across all rows, arranged vertically.
📝 Syntax
advanced2:00remaining
Identify the correct SQL syntax to select specific columns
Which SQL query correctly selects only the name and department columns from the Employees table?
Attempts:
2 left
💡 Hint
Remember the syntax for selecting multiple columns uses commas.
✗ Incorrect
Option A uses correct SQL syntax with commas separating column names.
🔧 Debug
advanced2:00remaining
Find the error in this SQL query
What error will this SQL query produce?
SELECT id, name, department FROM Employees WHERE department = Sales;
Attempts:
2 left
💡 Hint
String values in SQL must be enclosed in quotes.
✗ Incorrect
The value Sales is a string and must be enclosed in single quotes to avoid syntax error.
❓ optimization
expert2:30remaining
Optimize query to count rows efficiently
Which query is the most efficient way to count the number of employees in the Employees table?
Attempts:
2 left
💡 Hint
Use SQL aggregate functions designed for counting rows.
✗ Incorrect
COUNT(*) counts all rows efficiently without filtering or extra conditions.