Troubleshooting errors | BUS 104 – SQL Exam

Still feeling nervous for your exam? Check out the SQL Cram Kit for practice questions that emulate the difficulty that you'll face on your exam. Each question includes a thorough step-by-step explanation where I walk you through the entire problem solving process!

SQL Cram Kit logo

ERROR: not a single-group function

Simply put, you forgot your GROUP BY statement.

In GROUP BY | SQL in 30 Minutes, we discussed the golden rule of GROUP BY statements:

Whenever you have field(s) and aggregate function(s) in your SELECT statement, you must include all field(s) in your GROUP BY statement.

So, if you get this error, chances are you didn't write a GROUP BY statement with all the field(s) of your SELECT statement.

For example, if I had the following SQL statement...

SELECT job_id, AVG(age)
FROM sample_database.survey_responses;

...I'd get "ERROR: not a single-group function" since I have not included my field(s), job_id, in a GROUP BY statement.

Therefore, adding a GROUP BY statement like so…

SELECT job_id, AVG(age)
FROM sample_database.survey_responses
GROUP BY job_id;

…will resolve this error.

ERROR: ambiguous column name

Ever been with a group of friends and two people are called "John"? And whenever someone calls for one of them, both of them respond?

That's essentially what's going on with this error.

You've ambiguously stated two columns in your SQL code and need to specify which table they're coming from.

For example, if we've got the following statement…

SELECT name, name
FROM sample_database.survey_responses
JOIN ON survey_responses.job_id =;

…SQL will get confused because it doesn't know which table each of the name fields are from.

Therefore, we can correct this mistake by placing the table that the field belongs to before the field like so:

FROM sample_database.survey_responses
JOIN ON survey_responses.job_id =;

Now SQL knows that in the first column, we want to display the name field values from the survey_responses table, and in the second column we want to display the name field values from the jobs table.

ERROR: syntax error

This error is a little bit more difficult to troubleshoot since it's less specific. There's 3 main things you need to look at when this error arises.

1) Missing semicolon

There's a chance you forgot to place a semicolon at the end of your SQL statement.

For example, if we had this statement:

FROM sample_database.survey_responses

We can fix this error simply by placing a semi-colon at the end like so:

FROM sample_database.survey_responses;

Because it signifies the end of your SQL statement. If you had multiple statements in one SQL script, not having semicolons would cause issues.

2) Order of statements

Make sure you have your SQL statements in the following order:


If you don't, you may get a syntax error.

3) Misspelling a statement

See something wrong with this query?


If you don't read word carefully, it can be tough to miss.


We misspelled "FROM" as "FORM".

To fix this, all we need to do is correctly spell it like so:


Got any other errors you're running into? Shoot me an email at and I'd be happy to help out!

SQL Follow-along Guide

It's no secret you retain info better when you write it down. That's why I created the SQL Follow-along Guide for you!

As you come upon key concepts highlighted in yellow, like this sentence here, you can fill-in-the-blanks on your Follow-along Guide so that you remember all the important stuff for later.

You can obtain the SQL Follow-along Guide for FREE by entering your email below!

Congratulations! You've gone through all the core concepts that will be on your SQL exam! Now what?

Practice, practice, practice.

I cannot emphasize enough how much more important it is to practice SQL rather than study it. Without practice, it's difficult to truly understand what you're coding when it comes time for your exam.

In the SQL Cram Kit, I've compiled practice questions that emulate the difficulty that you'll face on your exam. Each question includes a thorough step-by-step explanation where I walk you through the entire problem solving process. That way, you never feel lost, and are prepared to solve any exam problems thrown your way! Click below to get started!


Each exam concept broken down with relatable situations to your life!

ToolsSQL Follow-along Guide (FREE)
LessonWhat is SQL?
LessonTroubleshooting errors

Practice Problems

Include step-by-step explanations through each part of the problem!

SQL Cram Kit Logo

"The SQL Cram Kit was the best thing I could’ve done before my exam. It takes practice and more practice to be good at coding and that is what I needed."

Andrew Green
October 29, 2020

Rating: 5 out of 5.

Leave a Comment