PostgreSQL Associate SQL Query Operations Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Thames
T
Thames
Community Contributor
Quizzes Created: 11982 | Total Attempts: 187,298
| Attempts: 11 | Questions: 20 | Updated: Aug 15, 2026
Please wait...
Question 1 / 21
🏆 Rank #-- ▾
0 %
0/100
Score 0/100

1. Which aggregate function returns the average value?

Explanation

AVG() is the standard SQL aggregate function for calculating the arithmetic mean of values in a column. It adds the non-NULL values and divides their sum by the number of non-NULL values. The other listed function names are not the standard SQL aggregate function for this purpose.

Submit
Please wait...
About This Quiz
PostgreSQL Associate SQL Query Operations Quiz - Quiz

This quiz evaluates your proficiency in PostgreSQL SQL query operations at the associate level. It covers essential topics including SELECT statements, JOIN operations, aggregate functions, subqueries, data filtering, and query optimization. Perfect for professionals preparing for PostgreSQL certification or strengthening their database querying skills.

2.

What first name or nickname would you like us to use?

You may optionally provide this to label your report, leaderboard, or certificate.

2. A correlated subquery references columns from the outer query.

Explanation

A correlated subquery uses one or more columns from the outer query, linking its results to the current row being processed. It may be evaluated for each row of the outer query.

Submit

3. Which operator is used to check if a value exists in a list?

Explanation

The `IN` operator checks whether a value matches any value in a specified list or set. For example, `WHERE color IN ('red', 'blue')` selects rows whose color is either red or blue.

Submit

4. NULL values are treated as equal to zero in comparison operations.

Explanation

NULL represents a missing or unknown value, not zero. Comparisons involving NULL generally evaluate to UNKNOWN rather than treating it as zero; use `IS NULL` or `IS NOT NULL` to check for NULL values.

Submit

5. What does the CASE statement allow you to do in a query?

Explanation

The CASE statement evaluates conditions and returns a specified value for the first matching condition, allowing query results to display different values based on the data.

Submit

6. Which function converts text to lowercase in PostgreSQL?

Explanation

PostgreSQL’s `LOWER()` function converts all uppercase letters in a text value to lowercase. For example, `LOWER('Hello')` returns `hello`.

Submit

7. The UNION operator combines results from two queries and removes duplicates.

Explanation

UNION combines the rows returned by two SELECT queries into one result set and removes duplicate rows. The queries must return the same number of columns, with compatible data types in corresponding columns. Use UNION ALL when you want to keep duplicates.

Submit

8. Which clause must be used with aggregate functions like COUNT() to group results?

Explanation

GROUP BY organizes rows that share the same values in specified columns, allowing aggregate functions such as COUNT() to calculate a separate result for each group. For example, it can count how many records belong to each category.

Submit

9. What is the result of a CROSS JOIN between two tables with 3 and 4 rows respectively?

Explanation

A CROSS JOIN returns every possible combination of rows from the two tables. With 3 rows in one table and 4 in the other, each of the 3 rows is paired with all 4 rows, producing 3 × 4 = 12 rows.

Submit

10. A FULL OUTER JOIN returns rows that exist in either table.

Explanation

A FULL OUTER JOIN includes all rows from both tables. Rows with matching values are combined, while rows without a match still appear, with NULL values in the columns from the table where no match exists.

Submit

11. Which clause is used to filter rows after aggregation in a SELECT query?

Explanation

HAVING filters grouped results after aggregate functions are applied, such as groups whose total or average meets a condition. WHERE filters individual rows before grouping and aggregation, so it cannot be used to test aggregate values.

Submit

12. The WHERE clause filters rows before aggregation in GROUP BY operations.

Explanation

WHERE filters individual rows before they are grouped and aggregated. Conditions on grouped or aggregated results are instead applied using the HAVING clause.

Submit

13. What is the correct syntax for using LIMIT in PostgreSQL?

Explanation

PostgreSQL uses `LIMIT` to restrict the number of rows returned and `OFFSET` to skip rows before returning results. Here, the query skips the first 5 rows and returns the next 10. `TOP` is not PostgreSQL syntax.

Submit

14. Which function returns the maximum value in a column?

Explanation

In SQL, MAX() is an aggregate function that examines the values in a specified column and returns the greatest value found. It is commonly used with GROUP BY to find the maximum separately for each group. For example, MAX(salary) returns the highest non-NULL salary in the selected rows; NULL values are typically ignored.

Submit

15. A subquery is a query nested inside another query.

Explanation

A subquery is a query placed within another SQL query. It can provide data or conditions used by the outer query, such as filtering rows or calculating values.

Submit

16. What does the ORDER BY clause do in a query?

Explanation

The ORDER BY clause sorts the rows returned by a query according to one or more specified columns. By default, rows are sorted in ascending order; you can use ASC or DESC to choose the sort direction.

Submit

17. Which JOIN type returns all rows from the left table and matching rows from the right table?

Explanation

A LEFT JOIN returns every row from the left table, along with matching rows from the right table. If no match exists, the right table’s columns contain NULL values.

Submit

18. What is the purpose of the DISTINCT keyword in a SELECT statement?

Explanation

DISTINCT returns only unique rows in the query result, eliminating duplicates based on the selected columns. It does not sort the results, filter out NULL values, or limit the number of rows.

Submit

19. Which function returns the number of rows in a result set?

Explanation

COUNT() returns the number of rows in a result set, or the number of values in a specified column. It is commonly used in SQL queries to count records, such as `SELECT COUNT(*) FROM table_name;`.

Submit

20. What does an INNER JOIN return?

Explanation

An INNER JOIN combines rows from two tables only when the specified join condition matches. Rows without a corresponding match in the other table are excluded.

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which aggregate function returns the average value?
A correlated subquery references columns from the outer query.
Which operator is used to check if a value exists in a list?
NULL values are treated as equal to zero in comparison operations.
What does the CASE statement allow you to do in a query?
Which function converts text to lowercase in PostgreSQL?
The UNION operator combines results from two queries and removes...
Which clause must be used with aggregate functions like COUNT() to...
What is the result of a CROSS JOIN between two tables with 3 and 4...
A FULL OUTER JOIN returns rows that exist in either table.
Which clause is used to filter rows after aggregation in a SELECT...
The WHERE clause filters rows before aggregation in GROUP BY...
What is the correct syntax for using LIMIT in PostgreSQL?
Which function returns the maximum value in a column?
A subquery is a query nested inside another query.
What does the ORDER BY clause do in a query?
Which JOIN type returns all rows from the left table and matching rows...
What is the purpose of the DISTINCT keyword in a SELECT statement?
Which function returns the number of rows in a result set?
What does an INNER JOIN return?
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!