46|SQL – Barry Bee Benson Co

  1. It looks like he put LName in the where statement so his results included employees whose last name start with “B” rather than their first names starting with “B”

  2. On this one he ordered it descending instead of ascending for by location name

  3. He excluded “Brian” from the WHERE clause so his results don’t include the employees whose name is Brian

1 Like

The mistakes that Bradford made were:

  1. He included LName in the WHERE statement rather than FName.
  2. He ordered location by DESC instead of ASC in the ORDER BY statement.
  3. He forgot to add “Brian*” to the WHERE statement.
2 Likes

For the First one he included LName in the WHERE clause, for the second one he had Location DESC instead of just Location, then for the last one he didn’t put Brian in the WHERE Statement.

1 Like

Sounds like you learned a lot from this one. I want to try this challenge this week, and I hope I get the same things out of it.

In the first query Bradford put the LName in the WHERE when he should have used the Fname

Second, Bradford ordered the location by descending instead of alphabetically.

In the last query, Bradford only included matches for the names Brent and Bruce and not for the name Brian.

This was a good challenge to test my skills in querying multiple databases. I learned a lot from this practice.

He put Last name in the WHERE instead of the first name.
He ordered location descending order instead of alphabetically.
He left Brian out of the WHERE clause.
Thanks for the challenge!

In the first query, Bradford put LName instead of FName in the WHERE statement.
In the second query, Bradford ordered ascending instead of descending
In the third query, Bradford forgot Brian in the WHERE statement

I liked this challenge, it was not too difficult but good practice!

1 Like

For the first one, he used Last Name in the WHERE field, not First Name which results in 40 rows, with Barbeau as the first name. Where with the First Name included there should be 31 rows.

For the second one, he made the d.Location DESC in the ORDER BY column. Which made the results not correct.

For the final one, he just forgot to include Brian in the WHERE statement, which lowered the row number to 7, when there should be 29 rows.

2 Likes

In order to complete this challenge, we had to find the wrong areas where Bradford had messed up his SQL code. As I went through the document, these were the mistakes that I understood and hopefully helped correct:

  1. Bradford included the LName in the WHERE statement when it didn’t need to be there.
  2. Bradford did a DESC order in the d.Location when he didn’t need to.
  3. Bradford left out the last name “Brian” in his WHERE statement.

First= Used last name where he should have put first name in the WHERE statement.

Second= Put ORDER BY in ascending but not descending order

Third= Didn’t put Brian in the Where statement

These are his mistakes. Solution 1: Used LName in the WHERE statement
Solution 2: he sorted the data the opposite order
Solution 3: he didn’t search for Brian in his WHERE statement.

1 Like
  1. He used the last name in where when he should have put the first name in where
  2. He should put order by in ascending but not descending order
  3. He didn’t put Brian in the where statement

Barry’s mistakes are as follows:

  • He used WHERE with the last name instead of the first name
  • He used ORDER BY d.Location with descending when he shouldn’t have.
  • He forgot to include “Brian*” in the WHERE Catagory
  1. Bradford filtered the Last names in the WHERE statement instead of the first name
  2. Bradford sorted the locations in DESC order instead of ASC or alphabetically
  3. Brian was not included as a name in the WHERE statement

Braddford’s mistakes

  1. Instead of putting last name for the Where statement he put Firs name.
  2. HIS ORDER BY for locations was Descending not ascending.
  3. Brian was not included in the Where statement
1 Like

First Query: He included LName in the WHERE statement instead of FName.
Second Query: He sorted locations by descending order when he should have done ascending order.
Third Query: He did not include Brian in the WHERE statement.

1 Like

For the first one, Bradford put LName in the WHERE statement instead of FName.
For the second one, Bradford ordered d.Location by DESC instead of ASC.
For the third one, Bradford didn’t include “Brian” in the WHERE statement.

So i accidently solved the queries before reading the whole instructions. which was good practice, then i went back and did the actual problems.
He first used WHERE with last name instead of first name
then he Sorted in DESC instead of ASC
Lastly he forgot the name Brian in his Where statement.

Bradford, who has a weird obsession with “B”'s used SQL to try and return data sets, although he made a couple of errors that we discovered:

  • In the first return, he accidently used the last name column in place of the first name column in the WHERE statement.
  • For his second SQL, He ordered the locations in a descending order rather than ascending
  • In the last one, the instructions said that his query started with Brent Manion, but that name does not exist. rather if you remove Brian from the where statement, then the query started with Bruce Manion and only returned 6 results.
1 Like