46|SQL – Barry Bee Benson Co

Good challenge! It was a good practice problem to refresh my memory on SQL.

What Bradford did wrong was he put the Lname instead of Fname in the WHERE statement, he should have sorted by ASC instead of DESC, and he did not put the name Brian in the WHERE statement.

Here’s what Bradford did wrong:

-Query 1: He put LName instead of FName in the WHERE statement.
-Query 2: He ordered the Location by DESC, not ASC.
-Query 3: He didn’t include “Brian*” in his WHERE statement.

1 Like

Bradford’s mistakes: Used LName in the WHERE statement, sorted the data the opposite way, forgot to search for Brian in the WHERE statement.

It looks like in the first one he put the last name in the where statement instead of first name so it returned the last names that start with B instead.
On the second one he sorted the locations in reverse alphabetical order and needs to take out the DESC that is probably in there.
On the third one, he seems to have forgotten the name Brian after the WHERE part. He needs to add in that name in order to see the full results.

  1. He used LName in the WHERE function.
  2. He used ORDER BY as desc instead of asc or leaving it.
  3. He did not include Brian in the WHERE clause.

This was a fun challenge! Im excited to continue to learn more about SQL. Here are the mistakes I found.

For the first query:

  • Bradford used the wrong column (LName) in the WHERE clause instead of FName, leading to incorrect filtering.

For the second query:

  • Bradford used “DESC” in the ORDER BY clause, causing the results to be sorted in descending order instead of alphabetically.

For the final query:

  • Bradford omitted “Brian” from the WHERE statement, resulting in an understatement of the records retrieved.
3 Likes

I practiced writing the SQL code, then checked my answers against the Solutions. I found these mistakes:

  1. He used LName instead of FName in his WHERE function
  2. He ordered by Location descending instead of ascending
  3. He left “Brian” out of the WHERE statement so there were less rows
  1. Bradford put LName instead of FName in his WHERE statement.
  2. He sorted by DESC instead of ASC.
  3. He forgot to search for “Brian” in his WHERE statement.
    -This challenge was a good refresher for remembering all the Querying we learned in IS 201.

That’s awesome you typed out all the correct code. Great work!

Based on the correct return results, Bradford’s problem in his first query is that he requested records with employees’ last names that start with B, not first names. In his second query, he ordered the location in reverse alphabetical order. In the last query, Bradford forgot to include “Brian” in the WHERE statement.

Bradford made mistakes in his SQL statements. In the first he included the LName in the WHERE statement, in the second he made put DESC after d.Location in the ORDER BY statement, changing the order of the query. Lastly, Bradford forgot to search for Brian in his final WHERE statement.

In examining the notes above and the attached solution files, I was able to deduce Bradford’s errors
–He included LName in the WHERE statement instead of FName (1)
–He ordered d.Location as DESC instead of ASC. (2)
–He left “Brian” out of his WHERE statement. This meant onlt Brent and Bradford were displayed. (3)

I appreciate your clarity of response. You nailed the problem!

I thought I was supposed to fix the queries, but I need to go through the instructions and find his mistakes.

  1. Where statement shouldn’t include LName.
  2. Sorted the data wrong.
  3. Didn’t include Brian.

Here’s what I think was wrong:

  1. Barry used LName where he should have used Fname in the WHERE sequence
  2. Barry should have left the ORDER BY statement blank or put ASC rather than DESC so it was ordered improperly. Order By will assume ASC order unless told otherwise
  3. Barry forgot to include “Brian” in the WHERE sequence
  1. Bradford used Last Name instead of First name in the WHERE parameter
  2. When ordering the query, he used descending order instead of ascending
  3. He forgot to list Brian in the WHERE parameter

First query , Bradford used ‘LName’ in the WHERE clause instead of ‘FName’.

In the second query, he sorted the list in descending order by location, instead of ascending.

Last query, Bradford forgot to include the name ‘Brian’ in his WHERE statement

1 Like
  1. For the first task, Barry should have used the WHERE function to return first names that start with the letter “B” instead of last names to achieve correct results
  2. used DESC for the ORDER BY statement with Location, should have used ascending
  3. Brian was not included in his WHERE statement, thus fewer rows were returned
1 Like
  1. It will return 41 instead of 30 results if you put LName instead of FName
  2. Barry ordered in in reverse-alphabetical order, putting ORDER BY d.Location DESC when it should have been left alone without the DESC
  3. He forgot to put WHERE e.FName like “Brian
1 Like

Okay, here is what I noticed about Bradford’s queries.

  1. He used the LName instead of the FName for his first query in the WHERE clause.
  2. Barry sorted the reverse of what he needed to by using the DESC instead of leaving it blank or using ASC.
  3. In his last query, Barry did not use Brian in his WHERE statement so he only got the results of Brent and Bruce.
1 Like

In the first one, he had L.LastName instead of L.First Name
In the second he made d.Location DESC in the OrderBy Column
In the last one, he forgot Brian in the WHERE Statement

Also, I tried to save and post my access queries but I could not get it to save to a folder or pull up from my desk top. But I am just following the leader and explaining what was wrong with the queries.