6 kyu
SQL Basics: Simple NULL handling
8,432 of 8,434matt c
Description:
For this challenge you need to create a SELECT
statement, this statement must have NULL
handling, using COALESCE
and NULLIF
.
If name
is an empty string, you must replace with '[product name not found]'
.
If card_name
is an empty string, you must replace with '[card name not found]'
.
If no price
is specified (i.e. price
is NULL
), or if the price is 50
or less, you must discard the row.
eusales table schema
- id
- name
- price
- card_name
- card_number
- transaction_date
resultant table schema
- id
- name
- price (greater than 50.00)
- card_name
- card_number
- transaction_date
NOTE: Your solution should use pure SQL. Ruby is used within the test cases to do the actual testing.
SQL
Fundamentals
Similar Kata:
Stats:
Created | Oct 26, 2016 |
Published | Oct 26, 2016 |
Warriors Trained | 19134 |
Total Skips | 2955 |
Total Code Submissions | 48932 |
Total Times Completed | 8434 |
SQL Completions | 8432 |
Total Stars | 164 |
% of votes with a positive feedback rating | 85% of 1053 |
Total "Very Satisfied" Votes | 785 |
Total "Somewhat Satisfied" Votes | 227 |
Total "Not Satisfied" Votes | 41 |
Total Rank Assessments | 8 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |