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

Comments

Projects
None yet
6 participants
@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

This comment has been minimized.

Member

gvwilson commented Nov 30, 2016

@remram44

This comment has been minimized.

Collaborator

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 from Where to put solutions to SQL challenges? to Solutions to SQL challenges Jan 29, 2018

slimlime added a commit to slimlime/sql-novice-survey that referenced this issue Feb 27, 2018

Add solution: group_concat ordered. swcarpentry#158 Solutions
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

Merge pull request #210 from slimlime/patch-1
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

Merge pull request #213 from swcarpentry/revert-210-patch-1
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.

Haleluyaluya commented Jun 6, 2018

Looking for missing Data
You may use Null values for your attributes such as your attribute=NULL or
you may use single quotes as value for the attribute
such as on my student table I am looking if there are any name ("sname') or sex ("ssex) values left empty:
select * from Student where sname=' ' or ssex=' ';
This retrieves for me if null values exist in two columns of the relation

@remram44

This comment was marked as off-topic.

Collaborator

remram44 commented Jun 6, 2018

@Haleluyaluya are you trying to report an issue? Please open a separate ticket if you have found a problem, thanks.

@slimlime

This comment has been minimized.

Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment