Skip to content
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

Solutions to SQL challenges #158

Open
ncarchedi opened this issue Nov 30, 2016 · 5 comments
Open

Solutions to SQL challenges #158

ncarchedi opened this issue Nov 30, 2016 · 5 comments

Comments

@ncarchedi
Copy link

@ncarchedi ncarchedi commented Nov 30, 2016

The guidelines here mention including solutions for all challenges, but I don't see a place to do this in the SQL episodes. Please advise :)

@gvwilson
Copy link
Member

@gvwilson gvwilson commented Nov 30, 2016

@remram44
Copy link
Contributor

@remram44 remram44 commented Jan 29, 2018

EpisodePR
01 Selecting Data✔️
02 Sorting and Removing Duplicates✔️
03 Filtering✔️
04 Calculating New Values✔️
05 Missing Datacontributions welcome
06 Aggregationcontributions welcome
07 Combining Data✔️
08 Data Hygiene✔️
09 Creating and Modifying Datacontributions welcome
10-11 Programmingsee list at #178
@remram44 remram44 changed the title Where to put solutions to SQL challenges? Solutions to SQL challenges Jan 29, 2018
slimlime added a commit to slimlime/sql-novice-survey that referenced this issue Feb 27, 2018
Worked on this in the recent workshop and initially used a nested query to achieve the desired result.

"Can you find a way to order the list by surname?"
Reduces a nested, ordered result set of concatenated `firstName`+`lastName` into a single tuple.

Uses a nested subquery to produce a concatenated `firstName`+`lastName` result set (ordered by the family name) before further concatenating each of those full name elements into a single output.

First contribution! Perhaps overly verbose in some places :). Can edit it down to just the plain SQL query.
r4space added a commit that referenced this issue Mar 12, 2018
Add solution: group_concat ordered. #158 Solutions
r4space added a commit that referenced this issue Mar 12, 2018
r4space added a commit that referenced this issue Mar 12, 2018
Revert "Add solution: group_concat ordered. #158 Solutions"
gcapes added a commit to gcapes/sql-novice-survey that referenced this issue Apr 4, 2018
gcapes added a commit to gcapes/sql-novice-survey that referenced this issue Apr 4, 2018
gcapes added a commit to gcapes/sql-novice-survey that referenced this issue Apr 4, 2018
gcapes added a commit to gcapes/sql-novice-survey that referenced this issue Apr 5, 2018
gcapes added a commit to gcapes/sql-novice-survey that referenced this issue Apr 5, 2018
rgaiacs added a commit to rgaiacs/swc-sql-novice-survey that referenced this issue Apr 17, 2018
@Haleluyaluya

This comment was marked as off-topic.

@remram44

This comment was marked as off-topic.

@slimlime
Copy link
Contributor

@slimlime slimlime commented Jul 6, 2018

Oops solution attempt PR #210

edited Previous February solution for Ordering When Concatenating https://github.com/swcarpentry/sql-novice-survey/commit/ac09460f88a8aa197deff5197a5f0e5a8a21ace6

Oops, reverted 50095d2 back to no solution?
Added solution to challenge: Ordering When Concatenating ( #158 #223)

Uninformative revert Merge commit message r4space/sql-novice-survey@50095d2 does not elaborate on if there was an issue with the solution, or if the formatting was broken?

@ErinBecker ErinBecker added this to the June 2019 Release milestone May 14, 2019
colinsauze added a commit to colinsauze/sql-novice-survey that referenced this issue Jul 24, 2019
Removes the requirement to order the results in final aggregation exercise on concatenating. There was no solution for this exercise and solving it required using sub queries which haven't been discussed until now. 

I've simplified it to no need the results to be ordered, but instead to require a colon character as a separator. This way there's still a reason to use group_concat. 

This has been previously discussed in bugs swcarpentry#158, swcarpentry#255 and swcarpentry#288. A previous solution was proposed and then retracted in pull request swcarpentry#210.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants