SQL with Harry Potter: Sorting Hat Comparators
Description:
There is truly no magic in the world; the Hogwarts Sorting Hat is SQL-based, its decision-making powers are common operators and prospectIve students are merely data - names, and two columns of qualities.
students
- id
- name
- quality1
- quality2
Slytherin are being quite strict this year and will only take students who are evil AND cunning.
Gryffindor will take students who are brave but only if their second quality is NOT evil.
Ravenclaw accepts students who are studious OR intelligent.
Hufflepuff will simply take those who have the quality hufflepuff.
(don't worry, for simplicity's sake 'brave' and 'studious' will only appear in quality1, and 'cunning' and 'intelligent' will only appear in quality2.)
Return the id, name, quality1 and quality2 of all the students who'll be accepted, ordered by ascending id.
Similar Kata:
Stats:
Created | Mar 29, 2018 |
Published | Mar 29, 2018 |
Warriors Trained | 13694 |
Total Skips | 947 |
Total Code Submissions | 39575 |
Total Times Completed | 9546 |
SQL Completions | 9546 |
Total Stars | 106 |
% of votes with a positive feedback rating | 89% of 975 |
Total "Very Satisfied" Votes | 790 |
Total "Somewhat Satisfied" Votes | 158 |
Total "Not Satisfied" Votes | 27 |
Total Rank Assessments | 8 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |