Programming

SQL Fundamentals - Programming

This SQL Fundamentals test evaluates your master the foundational concepts of SQL including SELECT statements and basic data querying.

Duration

Complete at your own pace or within the time limit

Questions

Multiple choice with one correct answer

Accuracy

Expert-reviewed questions with clear answer keys

Results

Instant detailed breakdown by topic area

SQL Fundamentals
Question 1/of
0%
00:00
Category
Difficulty:Medium

Loading Questions...

Preparing your assessment. This will only take a moment.

About This Test

This assessment tests your understanding of SQL basics and fundamental database query concepts.

This test measures your knowledge of SELECT statements, WHERE clauses, and basic filtering. You'll demonstrate understanding of data types, table structure, and fundamental query construction.

Questions start with simple queries and progress to basic filtering and sorting operations. Each question reinforces core SQL concepts essential for building more complex skills.

Use your results as a foundation for your SQL learning journey. Focus on any weak fundamentals before progressing to more advanced SQL topics and techniques.

What This Test Covers

SELECT and Filtering

Retrieving columns with SELECT, filtering rows with WHERE, and using operators, LIKE, and IN to narrow results.

Sorting and Limiting

Ordering results with ORDER BY, limiting rows returned, and removing duplicates with DISTINCT.

Basic Joins

Combining rows from two tables with INNER JOIN on a matching key to bring related data together.

Aggregation

Summarizing data with COUNT, SUM, AVG, MIN, and MAX, and grouping rows with GROUP BY.

Sample Questions

A few real questions from this test, with answers and explanations. Take the full test above for the complete set.

Which clause is used to retrieve specific columns from a table in SQL?

Answer: SELECT

SELECT names the columns to return in the result set. FETCH, GET, and READ are not SQL retrieval keywords for this purpose.

What does the WHERE clause do in a SELECT statement?

Answer: Filters rows based on a condition before grouping

WHERE filters individual rows using a condition, and it is applied before GROUP BY and HAVING. Sorting is ORDER BY and de-duplication is DISTINCT.

By default, in what order does ORDER BY sort results when no direction is specified?

Answer: Ascending (ASC)

ORDER BY defaults to ascending order. You must add DESC explicitly to sort from highest to lowest.

What does the DISTINCT keyword do in SELECT DISTINCT city FROM customers?

Answer: Returns only the unique values of the city column

DISTINCT eliminates duplicate rows from the result, so each city value appears once. It does not sort or count on its own.

How should you test whether a column value is NULL in standard SQL?

Answer: WHERE col IS NULL

NULL represents unknown, so comparisons with = return unknown rather than true. IS NULL and IS NOT NULL are the correct predicates.

Frequently Asked Questions

Find answers to common questions about this assessment

WHERE filters individual rows before grouping, so it cannot reference aggregate functions. HAVING filters groups after GROUP BY has aggregated them, so it can use functions like COUNT or SUM. For example, WHERE narrows which orders to include, while HAVING keeps only groups whose total exceeds a threshold.

An INNER JOIN returns only rows that have a matching value in both tables based on the join condition. Rows without a match in either table are excluded. For example, joining customers and orders on a customer id returns only customers who have at least one order, pairing each order with its customer.

GROUP BY collapses rows that share the same values in the listed columns into a single group, so you can apply aggregate functions per group. For instance, grouping orders by customer lets COUNT return the number of orders each customer placed. Non-aggregated columns in the SELECT must appear in the GROUP BY.

DISTINCT removes duplicate rows from the result so each combination of the selected columns appears only once. For example, SELECT DISTINCT country from a customers table returns the unique list of countries. It applies across all selected columns together, not just the first one.

Scores are based on the number of correct answers divided by total questions, with a breakdown by topic category.

Yes, questions are randomly selected and ordered from our question bank to ensure each attempt is unique.

No account is required. You can take the test immediately. Optionally provide an email to save your results.

There is no pass/fail threshold. The test measures your knowledge level and provides detailed feedback for improvement.

For knowledge tests, we recommend answering without external help to get an accurate assessment. Practice exercises are designed for learning, so references are acceptable.

Our questions are written for structured educational practice and can give a useful snapshot of your current knowledge in the tested topics.

Ready to Test Your Knowledge?

Start the assessment now and discover your strengths