0
0
SQLquery~20 mins

SELECT all columns in SQL - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Master of SELECT all columns
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
2:00remaining
What is the output of this query?
Given a table Employees with columns id, name, and department, what will this query return?

SELECT * FROM Employees WHERE department = 'Sales';
SQL
SELECT * FROM Employees WHERE department = 'Sales';
AAll columns of employees who work in the Sales department
BOnly the 'department' column for employees in Sales
CAll employees regardless of department
DSyntax error due to missing column names
Attempts:
2 left
💡 Hint
The asterisk (*) means select all columns, but the WHERE clause filters rows.
query_result
intermediate
2:00remaining
What does this query return?
Consider a table Products with columns product_id, name, and price. What will this query output?

SELECT * FROM Products WHERE price > 100;
SQL
SELECT * FROM Products WHERE price > 100;
AAll columns of products priced above 100
BOnly the 'price' column for products above 100
CAll products regardless of price
DAn error because * cannot be used with WHERE
Attempts:
2 left
💡 Hint
The * selects all columns, and WHERE filters rows by price.
📝 Syntax
advanced
2:00remaining
Which query is syntactically correct to select all columns from the table Orders?
Choose the correct SQL query that selects all columns from the Orders table.
ASELECT * FROM Orders WHERE;
BSELECT ALL COLUMNS FROM Orders;
CSELECT ALL FROM Orders;
DSELECT * FROM Orders;
Attempts:
2 left
💡 Hint
The standard way to select all columns uses * after SELECT.
optimization
advanced
2:00remaining
Which query is more efficient to select all columns from Customers with country 'USA'?
You want to get all columns for customers from the USA. Which query is better for performance?
ASELECT * FROM Customers WHERE country = 'USA';
BSELECT id, name, email, country FROM Customers WHERE country = 'USA';
CSELECT * FROM Customers;
DSELECT country FROM Customers WHERE country = 'USA';
Attempts:
2 left
💡 Hint
Selecting only needed columns can improve performance.
🧠 Conceptual
expert
3:00remaining
What happens if you use SELECT * in a join query with tables Authors and Books?
Given two tables, Authors (id, name) and Books (id, title, author_id), what will this query return?

SELECT * FROM Authors JOIN Books ON Authors.id = Books.author_id;
SQL
SELECT * FROM Authors JOIN Books ON Authors.id = Books.author_id;
AOnly columns from Books table for matching rows
BOnly columns from Authors table for matching rows
CAll columns from both tables for matching author-book pairs
DSyntax error due to ambiguous column names
Attempts:
2 left
💡 Hint
SELECT * returns all columns from all tables in the FROM and JOIN clauses.