DATACAMP- Intro to SQL and Joins with
PostgreSQL| EXAM PRACTICE QUESTIONS AND
CORRECT ANSWERS (100% CORRECT VERIFIED
ANSWERS) 2024/2025
AVG - ✔✔calculate the mean of specific column values (ignoring NULL values)
MAX - ✔✔calculate the maximum of specific column values
SUM - ✔✔add all the values in a specific column together
MIN - ✔✔calculate the minimum of specific column values
ORDER BY - ✔✔sort the query results
DESC - ✔✔specify that sorting should be done from largest number to smallest
GROUP BY - ✔✔specify that calculations (like AVG, MIN, MAX) should be summarized
by another column's values
HAVING - ✔✔filter the results of a GROUP BY operation
JOIN - ✔✔connect two tables
, ON - ✔✔specify the primary key - foreign key pair on which to base the JOIN
operation
INNER JOIN - ✔✔a connection between two tables;includes only those rows with
matching primary key - foreign key values
USING - ✔✔like the ON keyword in a JOIN statement; used when primary key /
foreign key columns have the same name
CASE - ✔✔used within a query to identify complex conditions (similar to IF, ELSIF,
ELSE logic).
WHEN - ✔✔used within a CASE expression to identify conditions
THEN - ✔✔used within a CASE expression to identify returned results
ELSE - ✔✔used within a CASE expression to identify the result if all WHEN conditions
fail
END - ✔✔used to end a CASE expression
INTO - ✔✔used to store the results of a SELECT statement within a new table
LEFT JOIN - ✔✔returns all records from the left table (table1), and the matched
records from the right table (table2)
PostgreSQL| EXAM PRACTICE QUESTIONS AND
CORRECT ANSWERS (100% CORRECT VERIFIED
ANSWERS) 2024/2025
AVG - ✔✔calculate the mean of specific column values (ignoring NULL values)
MAX - ✔✔calculate the maximum of specific column values
SUM - ✔✔add all the values in a specific column together
MIN - ✔✔calculate the minimum of specific column values
ORDER BY - ✔✔sort the query results
DESC - ✔✔specify that sorting should be done from largest number to smallest
GROUP BY - ✔✔specify that calculations (like AVG, MIN, MAX) should be summarized
by another column's values
HAVING - ✔✔filter the results of a GROUP BY operation
JOIN - ✔✔connect two tables
, ON - ✔✔specify the primary key - foreign key pair on which to base the JOIN
operation
INNER JOIN - ✔✔a connection between two tables;includes only those rows with
matching primary key - foreign key values
USING - ✔✔like the ON keyword in a JOIN statement; used when primary key /
foreign key columns have the same name
CASE - ✔✔used within a query to identify complex conditions (similar to IF, ELSIF,
ELSE logic).
WHEN - ✔✔used within a CASE expression to identify conditions
THEN - ✔✔used within a CASE expression to identify returned results
ELSE - ✔✔used within a CASE expression to identify the result if all WHEN conditions
fail
END - ✔✔used to end a CASE expression
INTO - ✔✔used to store the results of a SELECT statement within a new table
LEFT JOIN - ✔✔returns all records from the left table (table1), and the matched
records from the right table (table2)