FC0-U71 Data and Database Fundamentals Practice Question
A user needs to retrieve only the 'ProductName' and 'Price' columns from a table named 'Products' where the 'Category' is 'Electronics'. Which SQL statement should the user execute?
⚠ Common exam trap
The trap here is mixing up WHERE and HAVING; WHERE filters individual rows before grouping, while HAVING filters groups after aggregation.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
SELECT ProductName, Price FROM Products WHERE Category = 'Electronics';
The SQL SELECT statement retrieves data from a table. To get specific columns, you list them after SELECT. To filter rows, you use the WHERE clause. The correct statement selects ProductName and Price from Products and filters where Category equals 'Electronics'. This precisely meets the user's need to view only electronics products with their names and prices.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
SELECT ProductName, Price FROM Products HAVING Category = 'Electronics';
Why it's wrong here
The HAVING clause is used to filter groups after aggregation, typically with GROUP BY. Without a GROUP BY, using HAVING on a non-aggregated column like Category is invalid in most SQL dialects and will cause an error. The correct clause for row-level filtering is WHERE, so this statement fails.
- ✗
SELECT * FROM Products WHERE Category = 'Electronics';
Why it's wrong here
Using the asterisk returns all columns, not just ProductName and Price. While it filters by Category, it includes unnecessary data such as product ID, description, and stock level. The user specifically asked for only two columns, so this statement does not meet the requirement and may cause performance overhead by retrieving extra data.
- ✗
SELECT ProductName, Price FROM Products ORDER BY Category = 'Electronics';
Why it's wrong here
The ORDER BY clause sorts the result set but does not filter rows. This statement would return all products, sorted with electronics first (if the expression evaluates to true) but still including non-electronics. The user needs only electronics, so this does not satisfy the condition and returns unwanted rows.
- ✓
SELECT ProductName, Price FROM Products WHERE Category = 'Electronics';
Why this is correct
This statement correctly selects the two desired columns, specifies the table, and applies a filter on the Category column. It returns only the product names and prices for electronics, matching the user's requirement. The syntax is standard SQL and will work in any relational DBMS, making it the precise solution.
Go deeper
Related to this question
About these practice questions
Courseiva writes every FC0-U71 question from scratch — 988 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CompTIA exam blueprint
This FC0-U71 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the FC0-U71 exam.