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

Stats:

CreatedOct 26, 2016
PublishedOct 26, 2016
Warriors Trained12097
Total Skips2600
Total Code Submissions49595
Total Times Completed3554
SQL Completions3554
Total Stars144
% of votes with a positive feedback rating80% of 422
Total "Very Satisfied" Votes297
Total "Somewhat Satisfied" Votes84
Total "Not Satisfied" Votes41
Total Rank Assessments8
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • matt c Avatar
  • Dentzil Avatar
  • Voile Avatar
Ad