6 kyu
SQL Basics: Create a FUNCTION (DATES)
3,554matt c
Description:
For this challenge you need to create a basic Age Calculator function which calculates the age in years on the age field of the peoples table.
The function should be called agecalculator
, it needs to take 1 date and calculate the age in years according to the date NOW
and must return an integer.
You may query the people table while testing but the query must only contain the function on your final submit.
people table schema
- id
- name
- age
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 | 12097 |
Total Skips | 2600 |
Total Code Submissions | 49595 |
Total Times Completed | 3554 |
SQL Completions | 3554 |
Total Stars | 144 |
% of votes with a positive feedback rating | 80% of 422 |
Total "Very Satisfied" Votes | 297 |
Total "Somewhat Satisfied" Votes | 84 |
Total "Not Satisfied" Votes | 41 |
Total Rank Assessments | 8 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |