-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding solutions to challenge 1 #57
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job overall!
I'd like to see your query's a little more ordered like the last one I reviewed, but everything works pretty well. Also be careful when using alias, I haven't seen a lot the reserved word: AS
in your query's so you might wanna use it more often
@@ -114,7 +122,8 @@ Your query here | |||
5. How many offices are in the state of Colorado (United States). | |||
|
|||
``` | |||
Your query here | |||
select count(*) list_of_office from offices o | |||
where state_id = (select id from states s where name ilike 'colorado'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the only case when an ILIKE command should be used is when there's a pattern matching task to be done. Here I don't understand why a simple name = 'Colorado' wouldn't be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually a mistake from my side, I was just trying things and I have never had uses ILIKE before, I was testing how it behaved and forgot to change it to the original name = 'Colorado', my apologies
@@ -144,9 +163,16 @@ Your query here | |||
8. Show the uuid of the employee, first_name and lastname combined, email, job_title, the name of the office they belong to, the name of the country, the name of the state and the name of the boss (boss_name) | |||
|
|||
``` | |||
Your query here | |||
select e.uuid, concat(e.first_name, ' ' ,e.last_name) full_name, e.email, e.job_title, o.name company, c.name country, s.name state, m.first_name boss_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you could show this in a cleaner and more readable way
select
e.uuid,
concat(e.first_name, ' ' ,e.last_name) full_name,
e.email,
e.job_title,
o.name company,
c.name country,
s.name state,
m.first_name boss_name
No description provided.