6 kyu
SQL Basics - Monsters using CASE
11,152 of 11,153PG1
Description:
You have access to two tables named top_half and bottom_half, as follows:
top_half schema
- id
- heads
- arms
bottom_half schema
- id
- legs
- tails
You must return a table with the format as follows:
output schema
- id
- heads
- legs
- arms
- tails
- species
The IDs on the tables match to make a full monster. For heads, arms, legs and tails you need to draw in the data from each table.
For the species, if the monster has more heads than arms, more tails than legs, or both, it is a 'BEAST' else it is a 'WEIRDO'. This needs to be captured in the species column.
All rows should be returned (10).
Tests require the use of CASE. Order by species.
Please use pure SQL, only testing is done in Ruby.
Fundamentals
SQL
Similar Kata:
Stats:
Created | Jun 12, 2017 |
Published | Jun 12, 2017 |
Warriors Trained | 17196 |
Total Skips | 1723 |
Total Code Submissions | 43297 |
Total Times Completed | 11153 |
SQL Completions | 11152 |
Total Stars | 149 |
% of votes with a positive feedback rating | 92% of 1288 |
Total "Very Satisfied" Votes | 1090 |
Total "Somewhat Satisfied" Votes | 182 |
Total "Not Satisfied" Votes | 16 |
Total Rank Assessments | 13 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 8 kyu |